Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310067
b: refs/heads/master
c: 50ee93a
h: refs/heads/master
i:
  310065: 9879b84
  310063: 25f7410
v: v3
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Jun 1, 2012
1 parent 74b5614 commit f645dff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: 91daee988db38b0207eec719a3160b163c077007
refs/heads/master: 50ee93afcaa970620d1fb5a9894109a2ab152868
8 changes: 5 additions & 3 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,11 @@ struct file *nameidata_to_filp(struct nameidata *nd)

/* Pick up the filp from the open intent */
filp = nd->intent.open.file;
nd->intent.open.file = NULL;

/* Has the filesystem initialised the file for us? */
if (filp->f_path.dentry == NULL) {
if (filp->f_path.dentry != NULL) {
nd->intent.open.file = NULL;
} else {
struct file *res;

path_get(&nd->path);
Expand All @@ -836,6 +837,7 @@ struct file *nameidata_to_filp(struct nameidata *nd)
if (!IS_ERR(res)) {
int error;

nd->intent.open.file = NULL;
BUG_ON(res != filp);

error = open_check_o_direct(filp);
Expand All @@ -844,7 +846,7 @@ struct file *nameidata_to_filp(struct nameidata *nd)
filp = ERR_PTR(error);
}
} else {
put_filp(filp);
/* Allow nd->intent.open.file to be recycled */
filp = res;
}
}
Expand Down

0 comments on commit f645dff

Please sign in to comment.