Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4485672rwb; Tue, 8 Nov 2022 18:22:53 -0800 (PST) X-Google-Smtp-Source: AMsMyM4GRzEyXhxAG8q6pVNspO/k+uQrZLgZz6iJjwocREYZlPrVyIlASIHYPtuRHUo6bVqI0eNg X-Received: by 2002:a17:906:9bc8:b0:7ad:7e6a:50ac with SMTP id de8-20020a1709069bc800b007ad7e6a50acmr56941317ejc.66.1667960573108; Tue, 08 Nov 2022 18:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667960573; cv=none; d=google.com; s=arc-20160816; b=KQk4DfdiipfWh/X8YMR2GVaqOhJbfH9q9SiigS65XBvWjLmAzRZ8HXJvx3wqp2ceu7 Vy6qrpodXkfnzQ0opcQWWEbHEB+3eu/CS15NUpqZfcrpzAC7j1emqnMwLQH3xJork6U6 k3EoUqeNiDS9N/KI25nhatGQv/q/44rqV3alPg5jcKBFK0KCgPCsVtAGnN+D7SuBwjt/ lvfYotC5XTXf/Y0IHeb/Tr6fODCbgDfDB4+NoTgXFkCKH37Lv3kOg9523AG7Z5soTOJz nIQNDRBYPVs6AfErcTNA257eWHMO5zGr/ol2fdMFtfI9RHFLFp+QuZfZmRuXLSeG148h l6IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=mvUcP4HbntagmkOGfZf7WFmP0Hncswvrk5B3oyCzjwM=; b=SBG0hq5DEERlO+iwhq1KezbTmXVcm1p7It9HuaB/7MnClmab344eNfVc88HGIW/17d Qw+rGp+9HRBnwQgFXJo67yEa57/6Alx3Kx5+Pk61rtHUjvhx86gfDBJJOsKvfJJJ9Lts eEGT3mb6KQuIwM0wVUNVWhE0W4qJJNKyjXFQ+fV3KOue29EeiqNj/uw56uU0UT6qOsLS H0vVCygtk+mETqIu57ZuksgoWl7i1gFKqnUqXw+l6TCySBQKcwcuXvKPTL2pEiJq9I4U TcKuQDIKOitmpKNMY/0Pcb2ouVZgUKMg7im6cn/FQYNOFj3hC6f2nhrUTbMdj+Y4eit6 1v7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RSm0iYTz; 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 hg5-20020a1709072cc500b0078dc3cb8b41si14419250ejc.507.2022.11.08.18.22.30; Tue, 08 Nov 2022 18:22:53 -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=RSm0iYTz; 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 S229555AbiKICLp (ORCPT + 94 others); Tue, 8 Nov 2022 21:11:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbiKICLn (ORCPT ); Tue, 8 Nov 2022 21:11:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEBA866C9C for ; Tue, 8 Nov 2022 18:11:42 -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 7C77AB81CD7 for ; Wed, 9 Nov 2022 02:11:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1900FC433C1; Wed, 9 Nov 2022 02:11:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667959900; bh=el+9iDBLBzbkqcIXd+VbVRLhL+sNygO7vW88HQ7wz0Y=; h=Date:From:To:Subject:References:In-Reply-To:From; b=RSm0iYTzd8Ef9RbgEX2v/Tj3V1G/oN+I/GfMxdhJQMDwIzzoEOv+2oREZYoKQXAyE qdd8Fttb3PZb/C2wxomUuIvL6YVMZo9QxLOIote9coQJqsWlrPMWEGsGkMYL7KQqX+ B+/EezEPcmud4epjkW0cvC4n1o3PHxcR4CJgpdisHy5+Q+9B93PKLP/QHjtBgskLRs I7N2nJl9C9bfymZKKFvu95cyElE8IbU2VL3fqADYCRG1XvCkaqyZJDRkBo+oNpA527 91hvklb6XID/DP3u71YKGoH6ZIQIu6TWYR+ec7UalV7O+d+w/Wb7rvMTH/xTv5Nwaf 1zJRoxrsFiflw== Date: Tue, 8 Nov 2022 18:11:38 -0800 From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH v2] f2fs: allow to read node block after shutdown Message-ID: References: <20221109020917.4121067-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221109020917.4121067-1-jaegeuk@kernel.org> 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. Cc: stable@vger.kernel.org Fixes: 83a3bfdb5a8 ("f2fs: indicate shutdown f2fs to allow unmount successfully") Signed-off-by: Jaegeuk Kim --- - Cc: stable 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