aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-07-20 15:28:46 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-29 13:24:18 -0400
commitb5bcdda32736b94a7d178d156d80a69f536ad468 (patch)
treec42d7265bb18d691d80edaf27b3f97bad46fb1f7 /fs
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')
-rw-r--r--fs/open.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/open.c b/fs/open.c
index 1e914b397e12..8d2c8970029c 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -654,6 +654,7 @@ static int do_dentry_open(struct file *f,
654 if (unlikely(f->f_flags & O_PATH)) 654 if (unlikely(f->f_flags & O_PATH))
655 f->f_mode = FMODE_PATH; 655 f->f_mode = FMODE_PATH;
656 656
657 path_get(&f->f_path);
657 inode = f->f_path.dentry->d_inode; 658 inode = f->f_path.dentry->d_inode;
658 if (f->f_mode & FMODE_WRITE) { 659 if (f->f_mode & FMODE_WRITE) {
659 error = __get_file_write_access(inode, f->f_path.mnt); 660 error = __get_file_write_access(inode, f->f_path.mnt);
@@ -739,9 +740,7 @@ int finish_open(struct file *file, struct dentry *dentry,
739 int error; 740 int error;
740 BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */ 741 BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
741 742
742 mntget(file->f_path.mnt); 743 file->f_path.dentry = dentry;
743 file->f_path.dentry = dget(dentry);
744
745 error = do_dentry_open(file, open, current_cred()); 744 error = do_dentry_open(file, open, current_cred());
746 if (!error) 745 if (!error)
747 *opened |= FILE_OPENED; 746 *opened |= FILE_OPENED;
@@ -784,7 +783,6 @@ struct file *dentry_open(const struct path *path, int flags,
784 783
785 f->f_flags = flags; 784 f->f_flags = flags;
786 f->f_path = *path; 785 f->f_path = *path;
787 path_get(&f->f_path);
788 error = do_dentry_open(f, NULL, cred); 786 error = do_dentry_open(f, NULL, cred);
789 if (!error) { 787 if (!error) {
790 error = open_check_o_direct(f); 788 error = open_check_o_direct(f);