Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5026689pxj; Tue, 22 Jun 2021 13:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzgmKJLNFRuJ+j+GjoMDH0+oHvdLMwi3hMnoSuhuovKtsfaUTmF3SA1zhFZsz3JZ6OJCoZ X-Received: by 2002:a17:906:39d7:: with SMTP id i23mr5950019eje.121.1624393550014; Tue, 22 Jun 2021 13:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624393550; cv=none; d=google.com; s=arc-20160816; b=i0AXWUoujFGJ4Fg5dZZysRCkFrdCbM2VJXYlshPQ5xYd880kxbkSGh0tzdTJ0IJuA2 SIpDfiPrb8JE11sUGAgexELlXCM07nNd0KInHvUJFepx76c1BdTsoDYojbVK5sv87MU6 l68LxgspwBy2DtRSwKIfn8kBJPWgUlz6OPcSyBnE2FZEKpEc7dNrcDCgYH3Fo22YUpXU abgDb+8hxcLvlpLtJYowQ2D9Wt1cJchZdLZQM5UWXlsCGzwOo8ncleBhDJqSwt/jvGVB 1mmb7OlSN6pghyYX14GGVNclPMSmDrb1ElRZxky1LdUHOxVPDCgnVGBJCd4Q2rV1o7N7 lx6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MEYnojIGZMqWRGMmAMN0M3nk6s1lUzkL/OjZ6RHSKeg=; b=1KSs8kPT5pnJ75A9zprXEVXygjI48iFMZwvtmUXKDFuSdI6E6P6681sHeK1QLPABj1 ta7Ev86c+KD1/cSVFBoiHBLBnC2mQFpxKlD2WOlHzJoCCe+GC/kQBLj0UzZa/w23neRo q10Q+VSP91ZVq3o+BCg4/Lo7YE6c29cQ4Q7BpsQFDQtVh5m7tkNQALZJpf/9Od4TDZrH yptnABk5ChRdXJUAr1qYJl8ytlh+jv311zyN2jBsjnswaoOls4zeFOF3Zg0L1JIO91+X ZhrhHZyh/ze/InANFKOrLZf9ThUWFqWEJpjbN8+IbMpeFhL+jVR2BylHYh2e8YJICzhy fEHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VJPJNCa9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w19si11230841edc.458.2021.06.22.13.25.26; Tue, 22 Jun 2021 13:25:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VJPJNCa9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbhFVUYi (ORCPT + 99 others); Tue, 22 Jun 2021 16:24:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:53222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbhFVUYf (ORCPT ); Tue, 22 Jun 2021 16:24:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EFCE260724; Tue, 22 Jun 2021 20:22:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624393339; bh=YiAxCf6fiPnI8bJy6wNlmJjhebzXdmJijGBXG3hEx18=; h=From:To:Cc:Subject:Date:From; b=VJPJNCa91bYO3PAPUjo+cmmgiNiUJDqIm/6/Nmu2Q1QEsR/BFZncuFlhEu83yyRsY SDuIiSiqiIbDM1Qz6PDf+fTWq19Dpz/cNr23wQRstLowvNuwyfhgBcGWvBEmnMorPh gW4uEjj/QUr/oadnOrhGTCY0Nz1ZBVICmqL88+QNipdx4FtiHuOZ0MK814hNxhQvIq kT31lJTh9YamuD2X23XVe9Wfd4sBSrEAtaKfeosoj29LjMiWOYvyWRqg1CcOzyWw/d ZCFiIUElBPjYWPvonRAxvA3UkVS/nK2D6aDk+4TvMlUQV13Q5epIzG1gPnB7eNK5+R z7lIMUi/LFRFw== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: remove false alarm on iget failure during GC Date: Tue, 22 Jun 2021 13:22:17 -0700 Message-Id: <20210622202217.3864743-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.32.0.288.g62a8d224e6-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch removes setting SBI_NEED_FSCK when GC gets an error on f2fs_iget, since f2fs_iget can give ENOMEM and others by race condition. If we set this critical fsck flag, we'll get EIO during fsync via the below code path. In f2fs_inplace_write_data(), if (is_sbi_flag_set(sbi, SBI_NEED_FSCK) || f2fs_cp_error(sbi)) { err = -EIO; goto drop_bio; } Fixes: 9557727876674 ("f2fs: drop inplace IO if fs status is abnormal") Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index da5947b30142..0e42ee5f7770 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1451,10 +1451,8 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, if (phase == 3) { inode = f2fs_iget(sb, dni.ino); - if (IS_ERR(inode) || is_bad_inode(inode)) { - set_sbi_flag(sbi, SBI_NEED_FSCK); + if (IS_ERR(inode) || is_bad_inode(inode)) continue; - } if (!down_write_trylock( &F2FS_I(inode)->i_gc_rwsem[WRITE])) { -- 2.32.0.288.g62a8d224e6-goog