aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/open.c b/fs/open.c
index ebef0c5fa10c..dcefb2f02d10 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -670,6 +670,7 @@ static int do_dentry_open(struct file *f,
670 put_write_access(inode); 670 put_write_access(inode);
671 goto cleanup_file; 671 goto cleanup_file;
672 } 672 }
673 f->f_mode |= FMODE_WRITER;
673 } 674 }
674 675
675 f->f_mapping = inode->i_mapping; 676 f->f_mapping = inode->i_mapping;
@@ -715,11 +716,9 @@ static int do_dentry_open(struct file *f,
715 716
716cleanup_all: 717cleanup_all:
717 fops_put(f->f_op); 718 fops_put(f->f_op);
718 if (f->f_mode & FMODE_WRITE) { 719 if (f->f_mode & FMODE_WRITER) {
719 if (!special_file(inode->i_mode)) { 720 put_write_access(inode);
720 put_write_access(inode); 721 __mnt_drop_write(f->f_path.mnt);
721 __mnt_drop_write(f->f_path.mnt);
722 }
723 } 722 }
724cleanup_file: 723cleanup_file:
725 path_put(&f->f_path); 724 path_put(&f->f_path);