Skip to content

Commit d6d95de

Browse files
author
Al Viro
committed
lookup_one_len_unlocked(): use lookup_dcache()
No need to lock parent just because of ->d_revalidate() on child; contrary to the stale comment, lookup_dcache() *can* be used without locking the parent. Result can be moved as soon as we return, of course, but the same is true for lookup_one_len_unlocked() itself. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 74ff0ff commit d6d95de

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

fs/namei.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,6 @@ static int follow_dotdot(struct nameidata *nd)
14441444
* This looks up the name in dcache, possibly revalidates the old dentry and
14451445
* allocates a new one if not found or not valid. In the need_lookup argument
14461446
* returns whether i_op->lookup is necessary.
1447-
*
1448-
* dir->d_inode->i_mutex must be held
14491447
*/
14501448
static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir,
14511449
unsigned int flags)
@@ -2351,15 +2349,7 @@ struct dentry *lookup_one_len_unlocked(const char *name,
23512349
if (err)
23522350
return ERR_PTR(err);
23532351

2354-
/*
2355-
* __d_lookup() is used to try to get a quick answer and avoid the
2356-
* mutex. A false-negative does no harm.
2357-
*/
2358-
ret = __d_lookup(base, &this);
2359-
if (ret && unlikely(ret->d_flags & DCACHE_OP_REVALIDATE)) {
2360-
dput(ret);
2361-
ret = NULL;
2362-
}
2352+
ret = lookup_dcache(&this, base, 0);
23632353
if (ret)
23642354
return ret;
23652355

0 commit comments

Comments
 (0)