Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2454874rwb; Mon, 15 Aug 2022 05:59:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR6rqUt3MRhEKHdcAv4BdQ40N70mlicqd5AW88romlouDxMNbIuupMxB8pp/UuuYlYjcfc61 X-Received: by 2002:a63:210f:0:b0:41c:650c:aea4 with SMTP id h15-20020a63210f000000b0041c650caea4mr13310917pgh.267.1660568393042; Mon, 15 Aug 2022 05:59:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660568393; cv=none; d=google.com; s=arc-20160816; b=izpTWaqVj+ykyYCPgKGm7d3ddR7cqcS3s+MkjC4Kcww28nucczxSu60LgEGuJhsc4k C+6PIfCe9dEoFMEwkHCOqPwkx6ohkhakSO362Zycj47o74Fp/sugGkDrs+NREcNSE9UH MxeLXuaFyclL7kkzL9GuE6qc3CS5TsfwwevFV7DL8uloA3jXpnSfm+Omhcd63W6uk6IT Y5Z3bDBT900h3gCJyLe7fgopi4l4ZKP5oc5i/mR+6omm4M/JSV/2CXpLTrGng5dzrNX6 SdPs9Dt0P8MjlbmsTPBKFCzWq3A0Z8xcLxFc+j+TL/DHUyW1S8uQs2U9Yu9RtY+/rnJ+ N2VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=n75S+Zvu2U8usdhrT8zeE6ZLZYTI6vK5raZLekBHgbc=; b=f9uxJMKnWBQiyuOe1gtmTStbvfY5berU1uv90L3DXTHWKAM2IbT9eS4s442xqFoghk lWOw/skG4HspyFT5CpTcLcXqMCUwqqhFN/QsIoGdATvFVBi9tuF4SIdsjAyaw8BLyvjZ dGg2b6qFxOWns9LF17SOnihyCnebmU2dbX7nywRkC1aQAOxU/9H4L56N8Qkdut9807ZH cp3RkgPr0EK+lc29VIlI8uoL1pfQoa4yx/PAKUd0OguQtVNFf3MDjgM2lrTssMF1D9w1 Dj220H7X+kB16Ak0CBi+9VNh/tkBEuqXo5kY3irPaXFn7EMw3mSmfGP3rYgrAKDnuHhY pW0w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g24-20020a170902fe1800b0016ecdb9d821si9451728plj.603.2022.08.15.05.59.41; Mon, 15 Aug 2022 05:59:52 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232431AbiHOMOx (ORCPT + 99 others); Mon, 15 Aug 2022 08:14:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232004AbiHOMOp (ORCPT ); Mon, 15 Aug 2022 08:14:45 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E20322558A; Mon, 15 Aug 2022 05:14:43 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VMJKe7S_1660565679; Received: from 30.227.73.152(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VMJKe7S_1660565679) by smtp.aliyun-inc.com; Mon, 15 Aug 2022 20:14:40 +0800 Message-ID: <9dc534eb-e083-f2cd-404e-9fb56230def2@linux.alibaba.com> Date: Mon, 15 Aug 2022 20:14:38 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] erofs: fix error return code in erofs_fscache_meta_read_folio and erofs_fscache_read_folio Content-Language: en-US To: Sun Ke , xiang@kernel.org, chao@kernel.org Cc: kernel-janitors@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, yinxin.x@bytedance.com References: <20220815034829.3940803-1-sunke32@huawei.com> From: JeffleXu In-Reply-To: <20220815034829.3940803-1-sunke32@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 On 8/15/22 11:48 AM, Sun Ke via Linux-erofs wrote: > 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 readpage/readahead") > Signed-off-by: Sun Ke LGTM. Reviewed-by: Jingbo Xu > --- > 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 8e01d89c3319..b5fd9d71e67f 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) > > rreq = erofs_fscache_alloc_request(folio_mapping(folio), > folio_pos(folio), folio_size(folio)); > - if (IS_ERR(rreq)) > + if (IS_ERR(rreq)) { > + ret = PTR_ERR(rreq); > goto out; > + } > > 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) > > rreq = erofs_fscache_alloc_request(folio_mapping(folio), > folio_pos(folio), folio_size(folio)); > - if (IS_ERR(rreq)) > + if (IS_ERR(rreq)) { > + ret = PTR_ERR(rreq); > goto out_unlock; > + } > > pstart = mdev.m_pa + (pos - map.m_la); > return erofs_fscache_read_folios_async(mdev.m_fscache->cookie, -- Thanks, Jingbo