Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298379
b: refs/heads/master
c: 81e6f52
h: refs/heads/master
i:
  298377: b1c43e6
  298375: 8a682ae
v: v3
  • Loading branch information
Al Viro committed Mar 31, 2012
1 parent ff5341c commit df8ac0f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 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: a32555466caee38faeef4e44d7878ecbff1199bc
refs/heads/master: 81e6f520898edbda56e8680d338ace4f5694874e
31 changes: 16 additions & 15 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,22 +1208,14 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
dentry = __d_lookup(parent, name);
}

if (dentry && unlikely(d_need_lookup(dentry))) {
if (unlikely(!dentry))
goto need_lookup;

if (unlikely(d_need_lookup(dentry))) {
dput(dentry);
dentry = NULL;
goto need_lookup;
}
retry:
if (unlikely(!dentry)) {
struct inode *dir = parent->d_inode;
BUG_ON(nd->inode != dir);

mutex_lock(&dir->i_mutex);
dentry = __lookup_hash(name, parent, nd);
mutex_unlock(&dir->i_mutex);
if (IS_ERR(dentry))
return PTR_ERR(dentry);
goto done;
}
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval)
status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
Expand All @@ -1233,8 +1225,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
}
if (!d_invalidate(dentry)) {
dput(dentry);
dentry = NULL;
goto retry;
goto need_lookup;
}
}
done:
Expand All @@ -1249,6 +1240,16 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
nd->flags |= LOOKUP_JUMPED;
*inode = path->dentry->d_inode;
return 0;

need_lookup:
BUG_ON(nd->inode != parent->d_inode);

mutex_lock(&parent->d_inode->i_mutex);
dentry = __lookup_hash(name, parent, nd);
mutex_unlock(&parent->d_inode->i_mutex);
if (IS_ERR(dentry))
return PTR_ERR(dentry);
goto done;
}

static inline int may_lookup(struct nameidata *nd)
Expand Down

0 comments on commit df8ac0f

Please sign in to comment.