Commit b5bcdda3 authored by Al Viro's avatar Al Viro

take grabbing f->f_path to do_dentry_open()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5c33b183
...@@ -654,6 +654,7 @@ static int do_dentry_open(struct file *f, ...@@ -654,6 +654,7 @@ static int do_dentry_open(struct file *f,
if (unlikely(f->f_flags & O_PATH)) if (unlikely(f->f_flags & O_PATH))
f->f_mode = FMODE_PATH; f->f_mode = FMODE_PATH;
path_get(&f->f_path);
inode = f->f_path.dentry->d_inode; inode = f->f_path.dentry->d_inode;
if (f->f_mode & FMODE_WRITE) { if (f->f_mode & FMODE_WRITE) {
error = __get_file_write_access(inode, f->f_path.mnt); error = __get_file_write_access(inode, f->f_path.mnt);
...@@ -739,9 +740,7 @@ int finish_open(struct file *file, struct dentry *dentry, ...@@ -739,9 +740,7 @@ int finish_open(struct file *file, struct dentry *dentry,
int error; int error;
BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */ BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
mntget(file->f_path.mnt); file->f_path.dentry = dentry;
file->f_path.dentry = dget(dentry);
error = do_dentry_open(file, open, current_cred()); error = do_dentry_open(file, open, current_cred());
if (!error) if (!error)
*opened |= FILE_OPENED; *opened |= FILE_OPENED;
...@@ -784,7 +783,6 @@ struct file *dentry_open(const struct path *path, int flags, ...@@ -784,7 +783,6 @@ struct file *dentry_open(const struct path *path, int flags,
f->f_flags = flags; f->f_flags = flags;
f->f_path = *path; f->f_path = *path;
path_get(&f->f_path);
error = do_dentry_open(f, NULL, cred); error = do_dentry_open(f, NULL, cred);
if (!error) { if (!error) {
error = open_check_o_direct(f); error = open_check_o_direct(f);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment