Skip to content

Commit 8613a20

Browse files
author
Al Viro
committed
make lookup_one_len() safe to use with directory locked shared
Signed-off-by: Al Viro <[email protected]>
1 parent 88d8331 commit 8613a20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/namei.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2471,6 +2471,7 @@ static int lookup_one_len_common(const char *name, struct dentry *base,
24712471
*/
24722472
struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
24732473
{
2474+
struct dentry *dentry;
24742475
struct qstr this;
24752476
int err;
24762477

@@ -2480,7 +2481,8 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
24802481
if (err)
24812482
return ERR_PTR(err);
24822483

2483-
return __lookup_hash(&this, base, 0);
2484+
dentry = lookup_dcache(&this, base, 0);
2485+
return dentry ? dentry : __lookup_slow(&this, base, 0);
24842486
}
24852487
EXPORT_SYMBOL(lookup_one_len);
24862488

0 commit comments

Comments
 (0)