Skip to content
Snippets Groups Projects
Commit c3c4f694 authored by Al Viro's avatar Al Viro
Browse files

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 85d7d618
No related merge requests found
...@@ -727,6 +727,7 @@ static int do_dentry_open(struct file *f, ...@@ -727,6 +727,7 @@ static int do_dentry_open(struct file *f,
cleanup_all: cleanup_all:
fops_put(f->f_op); fops_put(f->f_op);
file_sb_list_del(f);
if (f->f_mode & FMODE_WRITE) { if (f->f_mode & FMODE_WRITE) {
put_write_access(inode); put_write_access(inode);
if (!special_file(inode->i_mode)) { if (!special_file(inode->i_mode)) {
...@@ -740,7 +741,6 @@ cleanup_all: ...@@ -740,7 +741,6 @@ cleanup_all:
mnt_drop_write(f->f_path.mnt); mnt_drop_write(f->f_path.mnt);
} }
} }
file_sb_list_del(f);
cleanup_file: cleanup_file:
path_put(&f->f_path); path_put(&f->f_path);
f->f_path.mnt = NULL; f->f_path.mnt = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment