Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3670366ioo; Mon, 30 May 2022 07:13:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmnnQ5QbOtbayjD99ZmsJU4ZHuY4ukD+Kkb/C4miIGArMMhRbOVs3tUhw/6u0MLAW427lE X-Received: by 2002:a05:6402:48c:b0:42a:e585:103 with SMTP id k12-20020a056402048c00b0042ae5850103mr58928607edv.375.1653920003977; Mon, 30 May 2022 07:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653920003; cv=none; d=google.com; s=arc-20160816; b=zhY1SPGap15ge1BNVNG8Vd39451bajZ5X5DNOmLbW/YsiaJiG61O4KKXvtfnXOoil7 7ZStj6vFA+71szI0apwCu9hsf9eVLSFPI6IvimK9lKWm0Q6fqG28YIxo5Sha8Xq6o78l lxF3Ne++EsM8aJnytg/JFr84kwglLsZRmXxIVwsFtsqeWj5xcNeUKsALuFCOkPmKMAWj CIGOATYXJRZXLXkSTOnrr98Lwy6Ai3qB5fIeqrKXLeKtHeQfaJ7g/3hoqdu3o5NGpRbG HULYw6QfbrXlY7k8gDIQU4LXI7DE+nxcFmmWm1AcASAUs5Az5UJ8ERgr70eIvULPMADZ 3nug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kWQq0Cn88HLsmrdESDZ42o7nCNRv8Za1ThOM0o4taxQ=; b=gGHzUtsaYIx5Vo2E6b/KvU0owcv40iaG7lF1uj2lp9xxUVNrBCpdSym0lQi0zzK5w8 FatdfsWZCbf7QdXFG4+ASKs4DYwzaRVY4tPsoqVzY8r/pqn25VuqGAiCb282MkFmaqQt sNnBTP1kEhG3G1e/KeL4T+b0FRifgs8l1PInoF6LJxbOsTPPQkv8sGGChcJfQ+iADEmT 7HsqpZb/zgg+ZDPZx88YFkOZJrPMnmO3o5kdGxLrO7HL05Xb0FYueuf2iP3walRLNJIZ x+WR1smGQXKKG7zHKETDoFKs13cJv1flZtvYp2hgTZMsjFN56DnqJgrGEYfzYEyp4kRT 5j+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="ETiH40/i"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz17-20020a0564021d5100b0042dd3f62a26si2592341edb.627.2022.05.30.07.12.56; Mon, 30 May 2022 07:13:23 -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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="ETiH40/i"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236061AbiE3MNe (ORCPT + 99 others); Mon, 30 May 2022 08:13:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232772AbiE3MNc (ORCPT ); Mon, 30 May 2022 08:13:32 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFFE0AE77 for ; Mon, 30 May 2022 05:13:29 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id x62so1427485ede.10 for ; Mon, 30 May 2022 05:13:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kWQq0Cn88HLsmrdESDZ42o7nCNRv8Za1ThOM0o4taxQ=; b=ETiH40/iyFN2AtDNl+SwVYIRE0FX+vCYzR2ZX/HdD1AKx4J792GfA2qCmw8TFBCxMu UV6T011ETCJ6el9OJtKYrD6EVBW2Iqh6r7oIT+/Noh/WJdRSKo/HwCZOECS9I5E17clE uJw96Ipmrmu6y5jxhYWpzfHxgL8iwB9Fv8rgk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kWQq0Cn88HLsmrdESDZ42o7nCNRv8Za1ThOM0o4taxQ=; b=7k2Yb4hfj5iRpk69tDKzYK/VvbNb0mJgg9Nx+Oayh+eF+ZXwb/fDvq+Ay6yByLVdle 7o524mqraM9ZpyMR8X+FUL/7HxpTaCRaJIHXLXI6B9CzFDDaEagq4WPW3D3vyGzOS9al LIqIf7ZgfE9ig6UeQU0g5Kn6HEUChcZWcJePShFO+rRzSaFycugknOnSPlx0BOb2n5Ls B5vArxW35cbTs3vgAV9wK4UoZHlGChDmg7Hieu+6JioENZ6D2PvvxM2nuolVUU1ggMzX LVqKiw87wwm5GH3x59GP3/oP+Z/k6MPfa45XKuvPTuYYOwGhuP36JSyrwz8xPYQHNpsf Xdug== X-Gm-Message-State: AOAM5324ESSHjOQg7TMMCHd7Q0T3Ci78QAl49zZA5HCZ5LDphrkw3lWI WoPd4m2YUauw4BC/h+R3K6ZDKnLAOwtdRGTS7RP8Jw== X-Received: by 2002:a05:6402:5210:b0:42b:7718:b6ef with SMTP id s16-20020a056402521000b0042b7718b6efmr35893562edd.22.1653912808479; Mon, 30 May 2022 05:13:28 -0700 (PDT) MIME-Version: 1.0 References: <20220523014838.1647498-1-chenxiaosong2@huawei.com> In-Reply-To: <20220523014838.1647498-1-chenxiaosong2@huawei.com> From: Miklos Szeredi Date: Mon, 30 May 2022 14:13:17 +0200 Message-ID: Subject: Re: [PATCH -next,v2] fuse: return the more nuanced writeback error on close() To: Jeff Layton Cc: ChenXiaoSong , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, liuyongqiang13@huawei.com, "zhangyi (F)" , zhangxiaoxu5@huawei.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 On Mon, 23 May 2022 at 03:35, ChenXiaoSong wrote: > > As filemap_check_errors() only report -EIO or -ENOSPC, we return more nuanced > writeback error -(file->f_mapping->wb_err & MAX_ERRNO). > > filemap_write_and_wait > filemap_write_and_wait_range > filemap_check_errors > -ENOSPC or -EIO > filemap_check_wb_err > errseq_check > return -(file->f_mapping->wb_err & MAX_ERRNO) > > Signed-off-by: ChenXiaoSong > --- > fs/fuse/file.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/fuse/file.c b/fs/fuse/file.c > index f18d14d5fea1..9917bc2795e6 100644 > --- a/fs/fuse/file.c > +++ b/fs/fuse/file.c > @@ -488,10 +488,10 @@ static int fuse_flush(struct file *file, fl_owner_t id) > inode_unlock(inode); > > err = filemap_check_errors(file->f_mapping); > + /* return more nuanced writeback errors */ > if (err) > - return err; > + return filemap_check_wb_err(file->f_mapping, 0); I'm wondering if this should be file_check_and_advance_wb_err() instead. Is there a difference between ->flush() and ->fsync()? Jeff, can you please help? Thanks, Miklos