aboutsummaryrefslogtreecommitdiff
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-07-20 23:28:46 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-29 21:24:18 +0400
commitb5bcdda32736b94a7d178d156d80a69f536ad468 (patch)
treec42d7265bb18d691d80edaf27b3f97bad46fb1f7 /fs/open.c
parent5c33b183a36500a5b0a3c53c11c431f0fec6efc8 (diff)
take grabbing f->f_path to do_dentry_open()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/open.c b/fs/open.c
index 1e914b397e1..8d2c8970029 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -654,6 +654,7 @@ static int do_dentry_open(struct file *f,
if (unlikely(f->f_flags & O_PATH))
f->f_mode = FMODE_PATH;
+ path_get(&f->f_path);
inode = f->f_path.dentry->d_inode;
if (f->f_mode & FMODE_WRITE) {
error = __get_file_write_access(inode, f->f_path.mnt);
@@ -739,9 +740,7 @@ int finish_open(struct file *file, struct dentry *dentry,
int error;
BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
- mntget(file->f_path.mnt);
- file->f_path.dentry = dget(dentry);
-
+ file->f_path.dentry = dentry;
error = do_dentry_open(file, open, current_cred());
if (!error)
*opened |= FILE_OPENED;
@@ -784,7 +783,6 @@ struct file *dentry_open(const struct path *path, int flags,
f->f_flags = flags;
f->f_path = *path;
- path_get(&f->f_path);
error = do_dentry_open(f, NULL, cred);
if (!error) {
error = open_check_o_direct(f);