summaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorChenXiaoSong <chenxiaosong2@huawei.com>2022-05-18 22:56:49 +0800
committerSteve French <stfrench@microsoft.com>2022-05-22 00:01:06 -0500
commit2b058acecf56f6b8fac781911a683219b9ca3b7b (patch)
tree61efe3717fc4c24d15c0e86440bc65a5a442db2c /fs/cifs/file.c
parentfb253d5ba3fcbd3b4216bcc37d019926f5e32ebb (diff)
downloadlinux-stable-2b058acecf56f6b8fac781911a683219b9ca3b7b.tar.gz
linux-stable-2b058acecf56f6b8fac781911a683219b9ca3b7b.tar.bz2
linux-stable-2b058acecf56f6b8fac781911a683219b9ca3b7b.zip
cifs: return the more nuanced writeback error on close()
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> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 03f217fa490d..89ebfee5c91c 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2777,8 +2777,11 @@ int cifs_flush(struct file *file, fl_owner_t id)
rc = filemap_write_and_wait(inode->i_mapping);
cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
- if (rc)
+ if (rc) {
+ /* get more nuanced writeback errors */
+ rc = filemap_check_wb_err(file->f_mapping, 0);
trace_cifs_flush_err(inode->i_ino, rc);
+ }
return rc;
}