From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5481DC4332F for ; Wed, 9 Nov 2022 02:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbiKICLq (ORCPT ); Tue, 8 Nov 2022 21:11:46 -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> 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 From mboxrd@z Thu Jan 1 00:00:00 1970 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 B7831C4332F for ; Wed, 9 Nov 2022 02:11:57 +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 1osaZI-00069X-UE; Wed, 09 Nov 2022 02:11:56 +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 1osaZ8-00069L-PW for linux-f2fs-devel@lists.sourceforge.net; Wed, 09 Nov 2022 02:11:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mvUcP4HbntagmkOGfZf7WFmP0Hncswvrk5B3oyCzjwM=; b=UMqhemyZZneK7uby3VjcgkK7LP R14yQQRZzeXEauu8jNIXXbfOyG1Vs5z5slj+8htAyEsj+9sTqT7dznTHjJHx8hD7Fa6knVX82VEtQ S7v/1ndVG2Gsof6uWSGtFrqFCdfb3qWfeLPnVb3JoW4oYjnEf7hw/V9Pid8+xtiTkLSQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To: From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mvUcP4HbntagmkOGfZf7WFmP0Hncswvrk5B3oyCzjwM=; b=DtD9/pb7u0oe5CuyJnAdEusd12 9QF3RNB2YScxeVcayDkNvo4unzLdHvbb0mCI/OROmgfBCoKraYEu9Fb+zTx2tTTh1EkhHrJmHNLBz 0vsqR9ZPRqK4gh4Pqc9A3uUgigPNskoaSPIVFyMEL5icX+iPTEwkCs8zMY+9GP20n9no=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1osaZ8-0001LE-5G for linux-f2fs-devel@lists.sourceforge.net; Wed, 09 Nov 2022 02:11:46 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id BC46061808 for ; Wed, 9 Nov 2022 02:11:40 +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 Message-ID: References: <20221109020917.4121067-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221109020917.4121067-1-jaegeuk@kernel.org> X-Headers-End: 1osaZ8-0001LE-5G Subject: Re: [f2fs-dev] [PATCH v2] f2fs: allow to read node block after shutdown 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel