Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1027757pxb; Fri, 15 Apr 2022 18:50:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6jv8cfB9zACYI3osLOy3ofPcVSNcSzLqfbiOLG1c7VPNsPgEp6wLaHpsrgZik5FYYnant X-Received: by 2002:a17:902:ccc4:b0:156:5d37:b42f with SMTP id z4-20020a170902ccc400b001565d37b42fmr1424689ple.157.1650073856815; Fri, 15 Apr 2022 18:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650073856; cv=none; d=google.com; s=arc-20160816; b=NY7jRKPpIiO56qDKXl7BGBjyuY1sc8gNnMtTqhykx/LpI2OVhC1/EMXZ9NWazyvqXU /P6sh25J8h2qsedRdgDZ1S4Q8nLFT+aCm0gCP0dxsXML4a9QH8PAPeQooLwZyULY57k8 jicoHQvtSLvjhK/MNR8H67ArZzQ5DtqP2QFemnsGQvn1BtuCWn/7UDGFXUY+Z+MVr59t +dlXXlOIZRH5ZbN2dYc5zp1v59mc2kbR7dafZZYvkdLyf/yrvrMwMkvxlLaZ435mw+8L GDiqI10I3H49nvnIiiArG6KMLZgggafLcuwlG1yADgSZOLfNynX4JpJFfv92CwTFZA2a VyYA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mTmakDrbwKtyN68bP7Eptqs19g/dAtoU1Zg030Sy7fc=; b=c9pRUXKCZNT/nB21lHSX2AzPQOvGI3Hzneaqi5lqwkiToAxSIvSqDGFmXahbUX6la5 dkm5JGpPufDK0k2jAhsrh7ETa4vkvOIYENPOOdk6Ejv/F5OFk3gS3w6xO/xgbdTZEJNy d58rkbRDx6WzzsaHBTgrEMbl4gBYO3dyeiLerDmRc6gI8XB/TDYrCvOzQwEORCjO5EHF ziXq8XQX+gw6lk9sPb8gmbgMhcQz6SvrSKKrNg6tDeeIoRsNZgToUGquv7+6Ue20kli9 /ilvfMNPlsNQ8ok/G2d373eSzeKiLZPreTKU3Q7c2ypysRQKLI57JWDETVyD6zheP03J AfuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="u4Xylr/P"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q2-20020a170902edc200b00153b2d164e0si2499026plk.232.2022.04.15.18.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="u4Xylr/P"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D1AC140E65; Fri, 15 Apr 2022 18:13:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244110AbiDNNYC (ORCPT + 99 others); Thu, 14 Apr 2022 09:24:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243954AbiDNNWI (ORCPT ); Thu, 14 Apr 2022 09:22:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4ADE972FE; Thu, 14 Apr 2022 06:17:37 -0700 (PDT) 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 82A14B82968; Thu, 14 Apr 2022 13:17:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F03E4C385A1; Thu, 14 Apr 2022 13:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649942255; bh=KLGo8g7kILFDsYSGimZs1OgY+bChucqqpbIHm8CuvKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u4Xylr/PCZ4z5CLxdUU0zczSw03f4GN2IsRwWS+IuaSo20Yuib3anyRpx+5zRdl+T IeBh8XqcZ08rfyObsmDMGzXKga1jk7hCE/xL5JV38DOE1HdGNUimF//DP6z+gLUqTW Q1MsGUJzlzM4wChKGNhVj4vNyB8NJGU65BDrjkPM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Chao Yu , Jaegeuk Kim Subject: [PATCH 4.19 030/338] f2fs: fix to unlock page correctly in error path of is_alive() Date: Thu, 14 Apr 2022 15:08:53 +0200 Message-Id: <20220414110839.749999630@linuxfoundation.org> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220414110838.883074566@linuxfoundation.org> References: <20220414110838.883074566@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Chao Yu commit 6d18762ed5cd549fde74fd0e05d4d87bac5a3beb upstream. 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/ Fixes: 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()") Cc: Reported-by: Pavel Machek Signed-off-by: Pavel Machek Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/gc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -589,8 +589,10 @@ static bool is_alive(struct f2fs_sb_info 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 = datablock_addr(NULL, node_page, ofs_in_node);