Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4483976rwb; Tue, 8 Nov 2022 18:20:48 -0800 (PST) X-Google-Smtp-Source: AMsMyM4zYmTFRJJ/7FoKlf9rxHC29OeEKzQOOlnbZ2Sfo1ePhdvQQaDLrcg0WA+6+QCeaprpzrje X-Received: by 2002:a05:6402:5207:b0:462:2426:48fc with SMTP id s7-20020a056402520700b00462242648fcmr58885397edd.93.1667960448315; Tue, 08 Nov 2022 18:20:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667960448; cv=none; d=google.com; s=arc-20160816; b=HO2UHkmIfS9s71E9MzBpGhWWQZjJPEOx3OnTuwj9KhDWAE6/TVHzmbgU2LktlaEjiK gy4ioEYCZ0Iwp7u38+ktBnh9B1VsEmBJPCnQKgrJvyKqX455QLa3wtxQFMH4sigqlme8 QwjovgZo+R6aETkvq2AxWykeyBGYwD3oO8ekcooQE81D9BVsfpvumuGLExuDmRGGkp+E b8j4BWOodOZDpJ0RchPL1NWNIv48Z0IW5IwJJSifSUZIJW3Q87vOY1g+k/fSmmHFdMQA YYZHtr2AuzOAebxURWGRWOw+oc3nHpyYUeNN3FcKXSecS8pfa/fqm0H01uxoxiPqqoRV w2Fw== 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=CPW61gTPsv5cTK2Rt9pFwr9nAryg+WUSR8h4GOH/oCk=; b=C4hAxvUfXENA8rEhUdnICx7pZdbOVUgojDXB9zhpxi2eOYm8EteJWWv7hufeg5p0+f DQvyPDE5oxYEizPo1q53CypzM2W9/l5HyIn3sDomCbQDa0yuR2drCIX6f+o9k1cR8TKu QsavOJ6VCkPYz7MWjBtsE1ynZ69TFT+Qyihccrgvw3XBoUA4E08AG6+Ew3nFWam3eDhP pLa0T5RSi6cpDep3d2rKcn9tPfExrqYls5BzM2/wGYqcONbPTIEA+UmbeqgiVQA22YzW p+a9Duq5JwUo+sGOQPn78pw/XGEcBbocfknrA+TodzDCHjBRyUSUEAfMo+kTfFidrShj 5pmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0R6UZj9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u25-20020aa7db99000000b00463c29b5443si12194829edt.27.2022.11.08.18.20.23; Tue, 08 Nov 2022 18:20:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e0R6UZj9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229818AbiKICJZ (ORCPT + 94 others); Tue, 8 Nov 2022 21:09:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbiKICJW (ORCPT ); Tue, 8 Nov 2022 21:09:22 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 149F55D698 for ; Tue, 8 Nov 2022 18:09:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BC269B81CF2 for ; Wed, 9 Nov 2022 02:09:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 633B8C433C1; Wed, 9 Nov 2022 02:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667959759; bh=GX1WjxW5uIqLEw8Wf86wBcBw2yon78ZixjUQkvdfwEM=; h=From:To:Cc:Subject:Date:From; b=e0R6UZj9AmzXm6wp3136fx0o1LvJiv/VAof9ELNn8s6q2CbXVQStgxEMGcgNykFDz rszEN5NztQnopREbtuR1A17yGS4s3zVWn9zi9Z0qYKGbpsvoHUEFcyJGl01NXi55OF xkZVnE3bMo2mdmkvBvCz7hXCPPC8MOygywIkvzihalQzAq1jVzsVoMV5qG1mie1cE/ PNu9mkCtWzDke1b98p4ddWi1ZuuCXJGLlsOinA65momdq6iDJPAbTKxDiQVQ/BCKgK pCXwle+mh97lr0xssPc3+vtM2SxDoq1bHeA/zWAGr7jDXiXpZW6JRCvtUZmGJEVPYZ lonJyYW+8db6A== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: allow to read node block after shutdown Date: Tue, 8 Nov 2022 18:09:17 -0800 Message-Id: <20221109020917.4121067-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If block address is still alive, we should give a valid node block even after shutdown. Otherwise, we can see zero data when reading out a file. Fixes: 83a3bfdb5a8 ("f2fs: indicate shutdown f2fs to allow unmount successfully") Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 983572f23896..b9ee5a1176a0 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1360,8 +1360,7 @@ static int read_node_page(struct page *page, blk_opf_t op_flags) return err; /* NEW_ADDR can be seen, after cp_error drops some dirty node pages */ - if (unlikely(ni.blk_addr == NULL_ADDR || ni.blk_addr == NEW_ADDR) || - is_sbi_flag_set(sbi, SBI_IS_SHUTDOWN)) { + if (unlikely(ni.blk_addr == NULL_ADDR || ni.blk_addr == NEW_ADDR)) { ClearPageUptodate(page); return -ENOENT; } -- 2.38.1.431.g37b22c650d-goog