Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320956
b: refs/heads/master
c: b5bcdda
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 29, 2012
1 parent 4432c26 commit 515b3c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c33b183a36500a5b0a3c53c11c431f0fec6efc8
refs/heads/master: b5bcdda32736b94a7d178d156d80a69f536ad468
6 changes: 2 additions & 4 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 515b3c9

Please sign in to comment.