mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next,v2] fuse: return the more nuanced writeback error on close()
@ 2022-05-23  1:48 ChenXiaoSong
  2022-05-30 12:13 ` Miklos Szeredi
  0 siblings, 1 reply; 6+ messages in thread
From: ChenXiaoSong @ 2022-05-23  1:48 UTC (permalink / raw)
  To: miklos
  Cc: linux-fsdevel, linux-kernel, chenxiaosong2, liuyongqiang13,
	yi.zhang, zhangxiaoxu5

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@huawei.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);
 
-	err = 0;
 	if (fm->fc->no_flush)
 		goto inval_attr_out;
 
-- 
v2: remove redundant code: err = 0

2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-31 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23  1:48 [PATCH -next,v2] fuse: return the more nuanced writeback error on close() ChenXiaoSong
2022-05-30 12:13 ` Miklos Szeredi
2022-05-30 14:02   ` Jeff Layton
2022-05-30 14:38     ` Miklos Szeredi
2022-05-30 22:33     ` NeilBrown
2022-05-31 15:31   ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®