Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp502340pxb; Mon, 7 Feb 2022 17:07:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyvwQS6EctrWvgEZby4WkZgW34BHBH0atpDRkD/sQ+62K5/jJkECK38v5XmiNMjIr3geZB X-Received: by 2002:a17:907:97c9:: with SMTP id js9mr1680053ejc.677.1644282441522; Mon, 07 Feb 2022 17:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644282441; cv=none; d=google.com; s=arc-20160816; b=Q634EoNA+6XN8L4/ozQ6VxfkKEffDhKmfg2D1XWLCXkF0w6ZYGwkhlVnA9Wvh9bgj9 3tLkmDEbcFw3p+VCd6DzWnHgt3ApCU1KPPBivqr5zoQHqTsuJ2ZMeWcAZVxymhOStvw5 qrIvUFyRDBaqewfYnu+1xCxaTSF0K56i4NlKreBGJzibi8W36skQbBPn/AbHREfQFqtI adXR/EINmoBM3XxK+Vxds5gv23ppQ+QvC27XuhSJ0gW4RcT81ES32W33TLIkbpqLi5dq AJURIYmlYGoPkglBotJdq0m+IG0iCtRi8HV56DDWz028c1HpkHgnBGrYcrUoi+PSXGmm 1nuw== 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:cc:to:from:date:dkim-signature; bh=n9IuIlk0CGto/oB+tgxwQgFOfL88ktJTvS4we9LD68Q=; b=aoyrGj/voz/RCp4MlDjaxbcfR6Mo3mjezvO2evE6WtVwL/+TBsy9W1LkSMxx0ZMR/8 FePhUIX2vwwCbj+8GLVp/UFEMhfzSVHDJ/S7awtak2TqyPLEO7mYtncVlnMjb4q+H8sN DD9KOAg6bWwrZLWKam4Gypz3u0zbXi5SBJErD93RWvyxl61q2j3HF2BtZ8qawZ4vW/q4 RwiKrLSlktYkt+3OOOkOU4gaBOEo/VC17/qUlkVrGIissOPGBTRvsIr/S9hBem2AIVKS CdGzk4DHn7KnxTN8tTRDiV5wQO1m/YjvXbAbDIbmT8ZXh2lsbp1EThYToA/A6c13eGZf 2oQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QwAcCqAL; 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 q20si6659798edw.78.2022.02.07.17.06.56; Mon, 07 Feb 2022 17:07:21 -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=QwAcCqAL; 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 S1353931AbiBCUDh (ORCPT + 99 others); Thu, 3 Feb 2022 15:03:37 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:51134 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353926AbiBCUDg (ORCPT ); Thu, 3 Feb 2022 15:03:36 -0500 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 8B06C619EB for ; Thu, 3 Feb 2022 20:03:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE22AC340E8; Thu, 3 Feb 2022 20:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643918616; bh=BYyFT3gy5b+xN2UQFHLCszX9c7Iabdr/TmYfxt+xQUI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QwAcCqAL/FVaQKM8cIMP+5ZlptqiakqUcwqpRfN6f+nVS99ComXMXrL96B4dyvDRT vzCKXRavC2X4Ea7OWwST1O4eZhwJMeNo3/IEuC3Bm54RVjXvaZG5S/9ROTalIpiMkO Jxmvbwr5ymrZR6K2J0Rg9mOBrtXyOT7LiMqKi/KTsLnQt8nJO3DF9yYvNq99h3+pFG v9N6WefJrpmJU8WSyB3+9WSPcexVU7AK/xhTERqXFeFz8laNvFTfJMcIQOSfoIh3Wk DcHVaLZclc250RHukoEqt5DZfEACEYc16iwXm5nrO0Wfj4NxNeZHJkd32PipNw7Qpi V/9uID0gXGKvA== Date: Thu, 3 Feb 2022 12:03:34 -0800 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Pavel Machek Subject: Re: [PATCH] f2fs: fix to unlock page correctly in error path of is_alive() Message-ID: References: <20220203144705.23528-1-chao@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220203144705.23528-1-chao@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/03, Chao Yu wrote: > As Pavel Machek reported in below link [1]: > > After commit 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()"), > node page should be unlock via calling f2fs_put_page() in the error path > of is_alive(), otherwise, f2fs may hang when it tries to lock the node > page, fix it. > > [1] https://lore.kernel.org/stable/20220124203637.GA19321@duo.ucw.cz/ Need -stable? It seems 4.19+? > > Fixes: 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()") > Reported-by: Pavel Machek > Signed-off-by: Pavel Machek > Signed-off-by: Chao Yu > --- > fs/f2fs/gc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index 0a6b0a8ae97e..2d53ef121e76 100644 > --- a/fs/f2fs/gc.c > +++ b/fs/f2fs/gc.c > @@ -1038,8 +1038,10 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, > set_sbi_flag(sbi, SBI_NEED_FSCK); > } > > - if (f2fs_check_nid_range(sbi, dni->ino)) > + if (f2fs_check_nid_range(sbi, dni->ino)) { > + f2fs_put_page(node_page, 1); > return false; > + } > > *nofs = ofs_of_node(node_page); > source_blkaddr = data_blkaddr(NULL, node_page, ofs_in_node); > -- > 2.32.0