Skip to content

Commit

Permalink
do_dentry_open(): close the race with mark_files_ro() in failure exit
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Al Viro committed Jul 14, 2012
1 parent 85d7d61 commit c3c4f69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ static int do_dentry_open(struct file *f,

cleanup_all:
fops_put(f->f_op);
file_sb_list_del(f);
if (f->f_mode & FMODE_WRITE) {
put_write_access(inode);
if (!special_file(inode->i_mode)) {
Expand All @@ -740,7 +741,6 @@ static int do_dentry_open(struct file *f,
mnt_drop_write(f->f_path.mnt);
}
}
file_sb_list_del(f);
cleanup_file:
path_put(&f->f_path);
f->f_path.mnt = NULL;
Expand Down

0 comments on commit c3c4f69

Please sign in to comment.