Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1882668rwb; Mon, 7 Nov 2022 06:53:44 -0800 (PST) X-Google-Smtp-Source: AMsMyM5URtT2L9I72Kow3ZMEX60yRZgoh3ZG3cGmXziFAoznxSngpO00+Ih9saagpFuYhV6RNbSo X-Received: by 2002:a17:907:a059:b0:78d:1a16:fc5c with SMTP id gz25-20020a170907a05900b0078d1a16fc5cmr48742896ejc.31.1667832824508; Mon, 07 Nov 2022 06:53:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667832824; cv=none; d=google.com; s=arc-20160816; b=V3FhnPD0siSdeEQgk3qA2YZsJHBeWG6XfWeqXaNl/sfIU5xdiLcBA8l8n/rwIow0nT gyBg5V0dkOKQDhm3RMlfNuI4Y/UScCIbekizg7l9HpXZusYi6cHMkQMGXC4MnFZt9JU+ ZSB/20+gi9TXu7amH+VnI1ijKT0UkZfHQwhBnxzvVRWfBRHNq4wDk3/+LL+7B+UPvAg9 wchseTB0oEGZTipWdyCmQhTLprwBmDQv8Rm2a25J3TROFPEj2FyGAjfEejClLcx9psq/ RhwR5PV6K2uzVM3kXATYYtl3Ek6mMxtnaLYVvW+8HHFmeG4oGbKhbgr/bgA++I9uyudy HOWQ== 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:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=lpaUCO78J+XfOOB4UTMko2tm5ZNs2acSxi/1vpzRt5Q=; b=o0hm4GpWB1+kGBUxtPrRvSU+yJ10QVO+OfkEbRuUuEFGIV6lcZWyrhz+HVTLhQ5S6C PbN3ldvamRp8JMsOhBBJTeCqex4UcbO4pLQWP8lb1Bouh2KxMC0ll0bLRY4ARB/1bkRg 05dqWQ75GUxRALxuwxLQVX7P/Zodxm1iVQP/07Tici9wtf6k/6AsQ+4p1T4Iyr5siiZd MJzTI9w5RIy8OE3wM2KIuqrwDXg7fAbCuO84jtG4m8QbLSHgOkn9iyRVSXRz17pmLpNj YJApKIS2bP0azT/6NIzhDwimUddis+f3biwY/KkDp6vkGIcn4coGOnELWJMRKO/PPRNM ttsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=NUw6dzVi; 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=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j21-20020a170906831500b0078e27f2fbe3si6747487ejx.115.2022.11.07.06.53.21; Mon, 07 Nov 2022 06:53:44 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=NUw6dzVi; 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=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231714AbiKGOmH (ORCPT + 93 others); Mon, 7 Nov 2022 09:42:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232475AbiKGOmF (ORCPT ); Mon, 7 Nov 2022 09:42:05 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 209C4F18 for ; Mon, 7 Nov 2022 06:42:02 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id 78so10606225pgb.13 for ; Mon, 07 Nov 2022 06:42:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=lpaUCO78J+XfOOB4UTMko2tm5ZNs2acSxi/1vpzRt5Q=; b=NUw6dzVijAV7U+uWIcyNo1dhTOCkGgatzrmZfs8T16BjAqgcGOeqDJlpV6HrRwpVlj Yvz84EIB276eXUgOK8rY1f2s6JToVHzCz9ch79YaZ1Sl1sJTvVafQCjpgW+6KpxueNj2 kIF49EuMfLvcG7BvlEiM1ncxEtfliNoXFGjXsCQ6JWrX25WerBI4OL3wOLpfRmwgAEM9 PPv6euiDUoir+NERawnA8B7z1b4qh0z+WFKg0vQr6CdWjpjgyfgEqPc2/fiCqwX5Q7Ls n/WO56fEGwDALDm2RLhvWLIggzXRKv6jp5pkrzYzoswPdPjb5hOt7uCa89O+lpQcr7Aw Qrpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=lpaUCO78J+XfOOB4UTMko2tm5ZNs2acSxi/1vpzRt5Q=; b=7qHLr2mmUvxXJ8taSBmxkYVkmDhmSIS3iUwFWqPmo9jPAJIPT62e8yK3vSZtYrqtPC tEvDJskhTJ41pscvFYULuQepAT3fiKWHx5hRosTJq5OPUAS5hFB5fBf2ZzQTVHV7M6fB NDObjt53af24dKUgaoeVntc39/GtWY4zzWJK4zuRQqEYEFMT0BaSKY2o97XyuUITdWgv j++5meVNnqyzCbiuvMiaPrzIcyxInGt+w09eMWzpuZ7LiqhEf9Kk/D2fHRoeCU5iM4Da uH66ATtk8TRlrSXSua2fspg9AoTBkOzDGvZ3lhR5CJCq5e5CIGXNEvGVpdLboX3WffXf KyNw== X-Gm-Message-State: ACrzQf26xFvMalVl4VWdMjcqZzk6orEnkwBRyuLTCt+7+ccuNxRQs82P vRenW1a2qIzg9FK6Kib9tP0zcw== X-Received: by 2002:a05:6a00:140f:b0:56e:1190:e731 with SMTP id l15-20020a056a00140f00b0056e1190e731mr28656854pfu.39.1667832121594; Mon, 07 Nov 2022 06:42:01 -0800 (PST) Received: from [10.4.186.187] ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id y13-20020a63fa0d000000b00460c67afbd5sm4294802pgh.7.2022.11.07.06.41.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Nov 2022 06:42:01 -0800 (PST) Message-ID: Date: Mon, 7 Nov 2022 22:41:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [External] [PATCH 1/2] erofs: put metabuf in error path in fscache mode To: Jingbo Xu , xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, linux-erofs@lists.ozlabs.org Cc: yinxin.x@bytedance.com, linux-kernel@vger.kernel.org References: <20221104054028.52208-1-jefflexu@linux.alibaba.com> <20221104054028.52208-2-jefflexu@linux.alibaba.com> From: Jia Zhu In-Reply-To: <20221104054028.52208-2-jefflexu@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 在 2022/11/4 13:40, Jingbo Xu 写道: > 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: Jia Zhu > --- > 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;