Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96995
b: refs/heads/master
c: e9baf6e
h: refs/heads/master
i:
  96993: 98ea9d5
  96991: bed64dd
v: v3
  • Loading branch information
Al Viro committed May 16, 2008
1 parent 1fe0221 commit 8d81018
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 23c4971e3d97de4e1b7961ca6eacee35aa15ce5f
refs/heads/master: e9baf6e59842285bcf9570f5094e4c27674a0f7c
12 changes: 8 additions & 4 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2003,18 +2003,22 @@ struct dentry *lookup_create(struct nameidata *nd, int is_dir)
if (IS_ERR(dentry))
goto fail;

if (dentry->d_inode)
goto eexist;
/*
* Special case - lookup gave negative, but... we had foo/bar/
* From the vfs_mknod() POV we just have a negative dentry -
* all is fine. Let's be bastards - you had / on the end, you've
* been asking for (non-existent) directory. -ENOENT for you.
*/
if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
goto enoent;
if (unlikely(!is_dir && nd->last.name[nd->last.len])) {
dput(dentry);
dentry = ERR_PTR(-ENOENT);
}
return dentry;
enoent:
eexist:
dput(dentry);
dentry = ERR_PTR(-ENOENT);
dentry = ERR_PTR(-EEXIST);
fail:
return dentry;
}
Expand Down

0 comments on commit 8d81018

Please sign in to comment.