From nobody Fri Dec 19 07:47:28 2025 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 200C7C54EE9 for ; Tue, 13 Sep 2022 14:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233724AbiIMO0J (ORCPT ); Tue, 13 Sep 2022 10:26:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233788AbiIMOYQ (ORCPT ); Tue, 13 Sep 2022 10:24:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3353C61B03; Tue, 13 Sep 2022 07:16:10 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5B827614C2; Tue, 13 Sep 2022 14:14:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68752C433D6; Tue, 13 Sep 2022 14:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078486; bh=W5/c/rz4SkjlvfKZ6VsL2xJxhvqUehoX+DDkoVI5Q/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u8k342hmN/Alo0XCu57EuOEtCnwgPnBbKA3kjtgGh9wZCQXYDF8oMIHLsMhKkpwq8 KZNWbw7JVOf7dls2GHAidyDuEjJju+RIvHCtQK85RlZ8/rK5pc/EWGnZ10QBFVolf2 qDflXOthNEzPxcNLNzyPmVxZzMoFXuHHrA5fHMns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sun Ke , Jingbo Xu , Gao Xiang , Chao Yu , Sasha Levin Subject: [PATCH 5.19 133/192] erofs: fix error return code in erofs_fscache_{meta_,}read_folio Date: Tue, 13 Sep 2022 16:03:59 +0200 Message-Id: <20220913140416.637808524@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140410.043243217@linuxfoundation.org> References: <20220913140410.043243217@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sun Ke [ Upstream commit 5bd9628b784cc5e38e1c7ebb680bbd6ee741230e ] If erofs_fscache_alloc_request fail and then goto out, it will return 0. it should return a negative error code instead of 0. Fixes: d435d53228dd ("erofs: change to use asynchronous io for fscache read= page/readahead") Signed-off-by: Sun Ke Reviewed-by: Jingbo Xu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220815034829.3940803-1-sunke32@huawei.com Signed-off-by: Gao Xiang Signed-off-by: Sasha Levin --- fs/erofs/fscache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index 8e01d89c3319e..b5fd9d71e67f1 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -222,8 +222,10 @@ static int erofs_fscache_meta_read_folio(struct file *= data, struct folio *folio) =20 rreq =3D erofs_fscache_alloc_request(folio_mapping(folio), folio_pos(folio), folio_size(folio)); - if (IS_ERR(rreq)) + if (IS_ERR(rreq)) { + ret =3D PTR_ERR(rreq); goto out; + } =20 return erofs_fscache_read_folios_async(mdev.m_fscache->cookie, rreq, mdev.m_pa); @@ -301,8 +303,10 @@ static int erofs_fscache_read_folio(struct file *file,= struct folio *folio) =20 rreq =3D erofs_fscache_alloc_request(folio_mapping(folio), folio_pos(folio), folio_size(folio)); - if (IS_ERR(rreq)) + if (IS_ERR(rreq)) { + ret =3D PTR_ERR(rreq); goto out_unlock; + } =20 pstart =3D mdev.m_pa + (pos - map.m_la); return erofs_fscache_read_folios_async(mdev.m_fscache->cookie, --=20 2.35.1