Skip to content

Commit 2b058ac

Browse files
ChenXiaoSongsmfrench
authored andcommitted
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>
1 parent fb253d5 commit 2b058ac

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/cifs/file.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2777,8 +2777,11 @@ int cifs_flush(struct file *file, fl_owner_t id)
27772777
rc = filemap_write_and_wait(inode->i_mapping);
27782778

27792779
cifs_dbg(FYI, "Flush inode %p file %p rc %d\n", inode, file, rc);
2780-
if (rc)
2780+
if (rc) {
2781+
/* get more nuanced writeback errors */
2782+
rc = filemap_check_wb_err(file->f_mapping, 0);
27812783
trace_cifs_flush_err(inode->i_ino, rc);
2784+
}
27822785
return rc;
27832786
}
27842787

0 commit comments

Comments
 (0)