]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/open.c
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / fs / open.c
index cd0c5be8d01247e8bab3f4e00e6f171803291881..35bb784763a4fde35558b10d8538cb9617a7c728 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -707,6 +707,9 @@ static int do_dentry_open(struct file *f,
        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);
+
        if (unlikely(f->f_flags & O_PATH)) {
                f->f_mode = FMODE_PATH;
                f->f_op = &empty_fops;
@@ -759,6 +762,7 @@ static int do_dentry_open(struct file *f,
             likely(f->f_op->write || f->f_op->write_iter))
                f->f_mode |= FMODE_CAN_WRITE;
 
+       f->f_write_hint = WRITE_LIFE_NOT_SET;
        f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
 
        file_ra_state_init(&f->f_ra, f->f_mapping->host->i_mapping);