aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-04-06 16:45:33 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-04-06 16:45:33 -0400
commit8613a209ffa6dd2c19c405fa699a062035dec9b0 (patch)
tree5007bf336b958f971913a84669b446d2afbb2151
parent88d8331afb0f76ad856770c49a0c0909d123b59c (diff)
make lookup_one_len() safe to use with directory locked shared
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/namei.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index ba48e154409b..6e0f6eea9896 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2471,6 +2471,7 @@ static int lookup_one_len_common(const char *name, struct dentry *base,
2471 */ 2471 */
2472struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) 2472struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
2473{ 2473{
2474 struct dentry *dentry;
2474 struct qstr this; 2475 struct qstr this;
2475 int err; 2476 int err;
2476 2477
@@ -2480,7 +2481,8 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
2480 if (err) 2481 if (err)
2481 return ERR_PTR(err); 2482 return ERR_PTR(err);
2482 2483
2483 return __lookup_hash(&this, base, 0); 2484 dentry = lookup_dcache(&this, base, 0);
2485 return dentry ? dentry : __lookup_slow(&this, base, 0);
2484} 2486}
2485EXPORT_SYMBOL(lookup_one_len); 2487EXPORT_SYMBOL(lookup_one_len);
2486 2488