[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJfpegt-+6oSCxx1-LHet4qm4s7p0jSoP9Vg8PJka3=1dqBXng@mail.gmail.com>
Date: Mon, 30 May 2022 14:13:17 +0200
From: Miklos Szeredi <miklos@...redi.hu>
To: Jeff Layton <jlayton@...nel.org>
Cc: ChenXiaoSong <chenxiaosong2@...wei.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
liuyongqiang13@...wei.com, "zhangyi (F)" <yi.zhang@...wei.com>,
zhangxiaoxu5@...wei.com
Subject: Re: [PATCH -next,v2] fuse: return the more nuanced writeback error on close()
On Mon, 23 May 2022 at 03:35, ChenXiaoSong <chenxiaosong2@...wei.com> 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 <chenxiaosong2@...wei.com>
> ---
> 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
Powered by blists - more mailing lists