Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312887
b: refs/heads/master
c: 54ef487
h: refs/heads/master
i:
  312885: 9d06a69
  312883: aa7a0c0
  312879: b8be360
v: v3
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Jul 14, 2012
1 parent 7b75a54 commit 9aed925
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 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: d58ffd35c1e595df2cf8ac4803f178c8be95ca7a
refs/heads/master: 54ef487241e863a6046536ac5b1fcd5d7cde86e5
12 changes: 11 additions & 1 deletion trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2209,14 +2209,24 @@ static struct file *lookup_open(struct nameidata *nd, struct path *path,
int *want_write, bool *created)
{
struct dentry *dir = nd->path.dentry;
struct inode *dir_inode = dir->d_inode;
struct dentry *dentry;
int error;
bool need_lookup;

*created = false;
dentry = lookup_hash(nd);
dentry = lookup_dcache(&nd->last, dir, nd, &need_lookup);
if (IS_ERR(dentry))
return ERR_CAST(dentry);

if (need_lookup) {
BUG_ON(dentry->d_inode);

dentry = lookup_real(dir_inode, dentry, nd);
if (IS_ERR(dentry))
return ERR_CAST(dentry);
}

/* Negative dentry, just create the file */
if (!dentry->d_inode && (op->open_flag & O_CREAT)) {
umode_t mode = op->mode;
Expand Down

0 comments on commit 9aed925

Please sign in to comment.