Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp546700rwl; Fri, 4 Nov 2022 03:38:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hn69hzoTOAH6M+33mCKfIVzQKA/47j8tAgMsb8I04wPc8/io4tax3rwyC3h/z53t+wY1/ X-Received: by 2002:a05:6a00:1884:b0:56c:636a:d554 with SMTP id x4-20020a056a00188400b0056c636ad554mr35119031pfh.18.1667558328069; Fri, 04 Nov 2022 03:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667558328; cv=none; d=google.com; s=arc-20160816; b=uQHh0SFKy4H0oVXKjgIUxmCmZO/VfBtV99QzOoJPSMZZp0hYZf5QfGhihee99YeFz1 SRqz0Xtb0ZJQTyo8ckzbUbOOd53VHSNbwQMqrSga0K652HzVfNUJRJn9ll+xnFnwebyf F7cPhZ1EbvKxh4h9xotD+nCQCl5MxpORAFfdQMgzkHuBByNdE2QFRop0NTJA8rfI/kJF 7BIVPw6R9ad299sQ/tXa9ZdQ7ol/gHmGzuaW8UjW/fWpfHGXzu4D6bzOtY+cTyJAqX0f 03h3BSureQZyQiSB+kkXJGEPGuGT1vI8hy1/11V003Hqa8Pleq52/FbgDkgKXLzM7mZC tgPw== 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; bh=U8D6Uqv3Lq5x/8vwzQvX2zAxQ+SjbcJ27XJx4Aeofag=; b=bLVF6gwTL55T+Z6kLRgpZHai+w/EN41JWikqWCJWhNG/n9X+hER1gLEUFYgk6zHjpQ 7xXYNgYiP6NDYXAJmS5Y2Hq5qCitZOJqUG4PTSpykKkx/fVo+ml2NraEyi9Tu9d0uYM2 r6v6ByESiRaM0sBIqeLd5SwnqfkIo8/pc7hv7ATNeL39EPEJr+rMDIwC6ojVSwNj5s7q bjXtrebOcJwVIGzcRJ9upLUmHg1gHzac6AT4Z3C80mhdDJDm1ISb22GTiu+NW5BG04qz V8vf9W6v87yu9b83PzCjCVqf0BDnsNp7UXEyRpL10SQiJj2yCcEcXC7ooHxh3szCz653 /GqA== 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 v18-20020a056a00149200b0056d3b0b4cdbsi4945157pfu.13.2022.11.04.03.38.36; Fri, 04 Nov 2022 03:38:48 -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 S229900AbiKDKD0 (ORCPT + 96 others); Fri, 4 Nov 2022 06:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231383AbiKDKDU (ORCPT ); Fri, 4 Nov 2022 06:03:20 -0400 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D68EC2B19F for ; Fri, 4 Nov 2022 03:03:16 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R451e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VTwgtpI_1667556191; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VTwgtpI_1667556191) by smtp.aliyun-inc.com; Fri, 04 Nov 2022 18:03:13 +0800 Date: Fri, 4 Nov 2022 18:03:11 +0800 From: Gao Xiang To: Jingbo Xu Cc: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, linux-erofs@lists.ozlabs.org, zhujia.zj@bytedance.com, yinxin.x@bytedance.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] erofs: put metabuf in error path in fscache mode Message-ID: References: <20221104054028.52208-1-jefflexu@linux.alibaba.com> <20221104054028.52208-2-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221104054028.52208-2-jefflexu@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,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 Fri, Nov 04, 2022 at 01:40:27PM +0800, Jingbo Xu wrote: > For tail packing layout, put metabuf when error is encountered. > > Fixes: 1ae9470c3e14 ("erofs: clean up .read_folio() and .readahead() in fscache mode") > Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Thanks, Gao Xiang > --- > fs/erofs/fscache.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c > index fe05bc51f9f2..83559008bfa8 100644 > --- a/fs/erofs/fscache.c > +++ b/fs/erofs/fscache.c > @@ -287,8 +287,10 @@ static int erofs_fscache_data_read(struct address_space *mapping, > return PTR_ERR(src); > > iov_iter_xarray(&iter, READ, &mapping->i_pages, pos, PAGE_SIZE); > - if (copy_to_iter(src + offset, size, &iter) != size) > + if (copy_to_iter(src + offset, size, &iter) != size) { > + erofs_put_metabuf(&buf); > return -EFAULT; > + } > iov_iter_zero(PAGE_SIZE - size, &iter); > erofs_put_metabuf(&buf); > return PAGE_SIZE; > -- > 2.19.1.6.gb485710b