From patchwork Mon Feb 5 03:14:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Bo X-Patchwork-Id: 13544946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 498A7C4828F for ; Mon, 5 Feb 2024 03:03:33 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rWpGb-0005c2-T8; Mon, 05 Feb 2024 03:03:29 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rWpGY-0005bv-Ir for linux-f2fs-devel@lists.sourceforge.net; Mon, 05 Feb 2024 03:03:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Pms2M3dtDRmLboEFI2NobDfl+l2d9SdMHXt6gMaUlyA=; b=XQCFeVEvXqMNiMXxpNA1bS1TAV uKnX5LK9L52j4bvXJByHnMbbmuYFrLfRgqpA3BoXE+snuYKrwJ/xxR43Q/JcRfLNSRUVx74gxLmqv zpVjxRuW/QLanXLctMBhF42NDACAAJRBUbokylUnDk4yA+GwUqB31YOpjmCSyZf6Wwuw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=Pms2M3dtDRmLboEFI2NobDfl+l2d9SdMHXt6gMaUlyA=; b=W yKCYPsP8/t8KfcfsJFF1xPtk8GE16HoNb0TXniUWc8PFNJiIxLp96RxeUBZMfMhSIfPIEWkmFa+sr /UHPJdT+p9Bm49r5DOCcLQSSXs2Go0qtDjSyMIPpOT0TVJYqJN3Ni6/w9PHNBDdvwEm4RZf01p2XA PiVc2z+IENn7C7ZE=; Received: from mail-tyzapc01on2085.outbound.protection.outlook.com ([40.107.117.85] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rWpGW-00048K-G9 for linux-f2fs-devel@lists.sourceforge.net; Mon, 05 Feb 2024 03:03:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jKvo7k5aGRTLsxKwKT5QeLeShIqsbhAxl3wV4sa2UENQOuvhfBGCkHZBsh0hNlndUs7pJhVMQZ7ZMMtNRhVo4c5CGxAPm9ik9UJhmj9PeDRYcfNmYo/DzZvLGvM1ZwTkcxv8jhPbYb5YpsbWgJ00RB75xHdVldTYGyoOiAGGmub2Yscq7/uisfGz2PoMtlt4YpbrJfjEprr6dbbMWwwO3/mytZdm3NA8c0fZr0kvkngGSQPFCX66ZKMLeQbvAa1K17w7gmRkOIIf4R8qNZdHp+jitCbLp72b9RDcme+jDTS1UNIR3M4NsYwQiiuyGQd05yQjuKL2qcyCFOVsbftZeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Pms2M3dtDRmLboEFI2NobDfl+l2d9SdMHXt6gMaUlyA=; b=XVfwIteaFjxjXAh8e03NNONP739JXCKM3GTXoN4AUNInLhYh9gooNPhSnEAwrHoKdv9aUtHE6bdXIFSeUxmUI7vo1c05gcAQE5jaTiB7NHXqOl/JIp++mGxk53u2yEcN+xRMNObYGdKCDZ9iHp9oadF5TGNVR2OmbLoufOE+9xKtWNv/5XoqXd6VFOt5LhMWlzabbkzLF+48hMWDaPApfHbDIJR5GycdYZTfqoWlbv52nfo06AUiDXEDaJtljYB6vipIyC10Q2xFCPKq6rLCvijfiznxu1bIV35GIXz3xW9KlWFfVM72F9vidr6pZpItS+NHkyTGHY0fzVr2nmfchw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pms2M3dtDRmLboEFI2NobDfl+l2d9SdMHXt6gMaUlyA=; b=n3SBa6YXYHoh2eEqe1h1s5t2niGott69oqLzfBU2kqd3rsuxC88E/1vGWH/vNS1KIoEZc3SF3EwES0gY7RomSSSNa8ZLiUg8zsOB/RprG1UqDJbky4w9g+uW4E8yseYZy+4/88R2IyIigRhJtI3KoSCc9iZs12PakPtiNj8lwc0/8X/Iva4eRgICdDQa0TfQKyzrLoTgk+N7Ggx54jtENwy+2F/Ra0I1ZhO7ky/mMyAU+mdVKbZ/sPk01MtdD4oXuns1P8HDrEb1GVew7ME0If1X+QZ3xG8SHT95ObJbSHqXsRk0kQ+omsdl0RxapQMwWFHCKuC16asNgAJUf1dhJQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) by TYZPR06MB4159.apcprd06.prod.outlook.com (2603:1096:400:2c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.34; Mon, 5 Feb 2024 03:03:11 +0000 Received: from PSAPR06MB4486.apcprd06.prod.outlook.com ([fe80::256c:56b4:d404:efd4]) by PSAPR06MB4486.apcprd06.prod.outlook.com ([fe80::256c:56b4:d404:efd4%5]) with mapi id 15.20.7249.032; Mon, 5 Feb 2024 03:03:10 +0000 To: Jaegeuk Kim , Chao Yu Date: Sun, 4 Feb 2024 20:14:15 -0700 Message-Id: <20240205031415.557879-1-bo.wu@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SGXP274CA0021.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::33) To PSAPR06MB4486.apcprd06.prod.outlook.com (2603:1096:301:89::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4486:EE_|TYZPR06MB4159:EE_ X-MS-Office365-Filtering-Correlation-Id: 5aa687d8-885e-43e6-2ce6-08dc25f6fc32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pg51Kh0AcHytjpTVsomvDtUiEpYdtlEVc6YYEE8fauKb4uKwvrbSohA1hIc3qOTZg2TlvIlylbJwg2Onu/EQb47bTBrmEz7pJLLVu6ZDzTrM4Y5FW9L2qE3LLMXOdlX6PN3sQqVmEgJs203EZVNv7YbsLaL5WiTI8rpVJKfFsi7ZO3FpDWASmCxhnca0cvZd1vRNRP8Hx0oZFI/Rg3m+qIAD9+7+fDpUEqtPdfLN5uuNp/oxGczVioQ9mO/+HW7wkHT2bZyGwFhKvi3l13TbBcfkEvCjpaP+GB5b049AsByiobUi41DYeH1wBKEzRWW1/eFlV5JJJ8MQhvuZareYdQCqKa5VMKXtA6Xc5ht+VR9F4QpAO/L5FV301kh8P+VyHcBcHBF+eLQWOzDYYrCMmowgp/NRDShtFc7eHunimkXYGkwIF5sCxzcpuYJYoArGqkxPz/jR/JfQbEDP6OMj+wiQT7mzfZfffigr/wQ1qpJWNgMVtl2JSB3Ml6nJSMYE1JQKs2m5N9H8WY3sCHpelCtY2inaeKL5KQoLnMTbJlDbbZR4Qp+rAR5LdN/ACi2rNtrZn8o62FLZmMXd367WLEBmi6ZKuZ8Y4P47QmvHYEA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PSAPR06MB4486.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(136003)(346002)(39850400004)(396003)(366004)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(41300700001)(38350700005)(110136005)(54906003)(66556008)(66476007)(66946007)(36756003)(316002)(2906002)(5660300002)(4326008)(8676002)(8936002)(83380400001)(38100700002)(6506007)(6512007)(52116002)(478600001)(6486002)(966005)(2616005)(26005)(1076003)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4Qrd2WrLOGLBvPqKZ7oml2+fSDCK3zuvQzgUaj7pRcHeUOAOCyFuCJq+rkAot6uaOujlNegjw2FDcoCHlnnLyVLcec7ErbzzO0RDOVB9EZ7lGYqiAbtvQryCWz88JJ+eLe94XJx8kLbIKld0yxar141ksZ2Sg4jlt6grC/2MTafdRJR5zDAL7I6fWHfY1qwypYZcQTUUM6XQuyGtKtm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+V5j+xJQiBNkQFWzrSSl/8Tl3W1aCVBffSGQxBzqvEJcq15Nf2HKoTzEpWdim8IFAccl1MDtooeEUzXwJmvFa19Df4aBv6lFQf1sOgGptNq1IaKYHQTtNWRpzzUDamzKUcz3W9J8hTsXkfnfhd5iF74UwSVghVy5pr6U4Cfhn7DKA+HLxrwgAtBYaWtHCjg57lTV5nKuMhFbKPReQS4bcKP0chFSbQY9JG4HV2dBgfKhmuPQYroYrV3kkocjv+UWbOkLGbexoSwEsIFIY/KKb8N6jzvRbupomvnrNKjgOmR5lAs39AejLW3d7nB1 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5aa687d8-885e-43e6-2ce6-08dc25f6fc32 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4486.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2024 03:03:10.6119 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DHtb/8Qcbz822mZjZybMOZmHeA9khcG8wSJU/H/Kl2+aMfyzh/vot/NatHYSs2xx/1f4aKWNfE9CtcYo7tcH8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB4159 X-Headers-End: 1rWpGW-00048K-G9 Subject: [f2fs-dev] [PATCH] Revert "f2fs: stop allocating pinned sections if EAGAIN happens" X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Wu Bo via Linux-f2fs-devel From: Wu Bo Reply-To: Wu Bo Cc: Wu Bo , stable@vger.kernel.org, linux-kernel@vger.kernel.org, Wu Bo , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This reverts commit 2e42b7f817acd6e8d78226445eb6fe44fe79c12a. If the GC victim section has a pinned block when fallocate() trigger FG_GC, the section is not able to be recycled. And this will return -EAGAIN cause fallocate() failed, even though there are much spare space as user see. As the GC policy prone to chose the same victim, fallocate() may not successed at a long period. This scenario has been found during Android OTA. Link: https://lore.kernel.org/linux-f2fs-devel/20231030094024.263707-1-bo.wu@vivo.com/t/#u CC: stable@vger.kernel.org Signed-off-by: Wu Bo Reviewed-by: Chao Yu --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index b58ab1157b7e..19915faccee9 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1725,7 +1725,7 @@ static int f2fs_expand_inode_data(struct inode *inode, loff_t offset, f2fs_down_write(&sbi->gc_lock); stat_inc_gc_call_count(sbi, FOREGROUND); err = f2fs_gc(sbi, &gc_control); - if (err && err != -ENODATA) + if (err && err != -ENODATA && err != -EAGAIN) goto out_err; }