Skip to content

Commit

Permalink
make lookup_one_len() safe to use with directory locked shared
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 6, 2018
1 parent 88d8331 commit 8613a20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2471,6 +2471,7 @@ static int lookup_one_len_common(const char *name, struct dentry *base,
*/
struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
{
struct dentry *dentry;
struct qstr this;
int err;

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

return __lookup_hash(&this, base, 0);
dentry = lookup_dcache(&this, base, 0);
return dentry ? dentry : __lookup_slow(&this, base, 0);
}
EXPORT_SYMBOL(lookup_one_len);

Expand Down

0 comments on commit 8613a20

Please sign in to comment.