Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298375
b: refs/heads/master
c: d774a05
h: refs/heads/master
i:
  298373: a5a3b47
  298371: c1a8887
  298367: 82e8cc8
v: v3
  • Loading branch information
Al Viro committed Mar 31, 2012
1 parent c7b1a00 commit 8a682ae
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 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: 08b0ab7c20f767187ae635d51bdd9d262ebe8357
refs/heads/master: d774a058d94d6b0dafada2295ec5221481b07d16
45 changes: 20 additions & 25 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,39 +1174,34 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,

mutex_lock(&dir->i_mutex);
dentry = d_lookup(parent, name);
if (likely(!dentry)) {
dentry = d_alloc_and_lookup(parent, name, nd);
if (IS_ERR(dentry)) {
mutex_unlock(&dir->i_mutex);
return PTR_ERR(dentry);
}
/* known good */
status = 1;
} else if (unlikely(d_need_lookup(dentry))) {
if (dentry && d_need_lookup(dentry)) {
dentry = d_inode_lookup(parent, dentry, nd);
if (IS_ERR(dentry)) {
mutex_unlock(&dir->i_mutex);
return PTR_ERR(dentry);
}
/* known good */
status = 1;
} else if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE))
} else if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) {
status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
if (status < 0) {
mutex_unlock(&dir->i_mutex);
dput(dentry);
return status;
}
if (!d_invalidate(dentry)) {
dput(dentry);
dentry = d_alloc_and_lookup(parent, name, nd);
if (IS_ERR(dentry)) {
if (unlikely(status <= 0)) {
if (status < 0) {
mutex_unlock(&dir->i_mutex);
return PTR_ERR(dentry);
dput(dentry);
return status;
}
/* known good */
status = 1;
if (!d_invalidate(dentry)) {
dput(dentry);
dentry = d_alloc_and_lookup(parent, name, nd);
if (IS_ERR(dentry)) {
mutex_unlock(&dir->i_mutex);
return PTR_ERR(dentry);
}
}
}
} else if (!dentry) {
dentry = d_alloc_and_lookup(parent, name, nd);
if (IS_ERR(dentry)) {
mutex_unlock(&dir->i_mutex);
return PTR_ERR(dentry);
}
}
mutex_unlock(&dir->i_mutex);
Expand Down

0 comments on commit 8a682ae

Please sign in to comment.