vfs: track per-sb writeback errors and report them to syncfs
[linux-block.git] / fs / open.c
index 719b320ede52bb1482afd28fc65b8282e9d6fb94..d9467a8a7f6a9f31c85b893de4f9d785fe0a4760 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -743,9 +743,8 @@ static int do_dentry_open(struct file *f,
        path_get(&f->f_path);
        f->f_inode = inode;
        f->f_mapping = inode->i_mapping;
-
-       /* Ensure that we skip any errors that predate opening of the file */
        f->f_wb_err = filemap_sample_wb_err(f->f_mapping);
+       f->f_sb_err = file_sample_sb_err(f);
 
        if (unlikely(f->f_flags & O_PATH)) {
                f->f_mode = FMODE_PATH | FMODE_OPENED;