diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-23 14:49:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:35:50 -0400 |
commit | c3c4f69424db0760239762d36d0b1b6ae524008b (patch) | |
tree | b8a6a5eb446d22604d362b7b718c2ff52c7812de /fs/open.c | |
parent | 85d7d618c17a09cfd824c1ad4483c19e6f9637ff (diff) |
do_dentry_open(): close the race with mark_files_ro() in failure exit
we want to take it out of mark_files_ro() reach *before* we start
checking if we ought to drop write access.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -727,6 +727,7 @@ static int do_dentry_open(struct file *f, | |||
727 | 727 | ||
728 | cleanup_all: | 728 | cleanup_all: |
729 | fops_put(f->f_op); | 729 | fops_put(f->f_op); |
730 | file_sb_list_del(f); | ||
730 | if (f->f_mode & FMODE_WRITE) { | 731 | if (f->f_mode & FMODE_WRITE) { |
731 | put_write_access(inode); | 732 | put_write_access(inode); |
732 | if (!special_file(inode->i_mode)) { | 733 | if (!special_file(inode->i_mode)) { |
@@ -740,7 +741,6 @@ cleanup_all: | |||
740 | mnt_drop_write(f->f_path.mnt); | 741 | mnt_drop_write(f->f_path.mnt); |
741 | } | 742 | } |
742 | } | 743 | } |
743 | file_sb_list_del(f); | ||
744 | cleanup_file: | 744 | cleanup_file: |
745 | path_put(&f->f_path); | 745 | path_put(&f->f_path); |
746 | f->f_path.mnt = NULL; | 746 | f->f_path.mnt = NULL; |