Skip to content

Commit 74ff0ff

Browse files
author
Al Viro
committed
namei: simplify invalidation logics in lookup_dcache()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent e9742b5 commit 74ff0ff

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

fs/namei.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,14 +1458,10 @@ static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir,
14581458
if (dentry->d_flags & DCACHE_OP_REVALIDATE) {
14591459
error = d_revalidate(dentry, flags);
14601460
if (unlikely(error <= 0)) {
1461-
if (error < 0) {
1462-
dput(dentry);
1463-
return ERR_PTR(error);
1464-
} else {
1461+
if (!error)
14651462
d_invalidate(dentry);
1466-
dput(dentry);
1467-
dentry = NULL;
1468-
}
1463+
dput(dentry);
1464+
return ERR_PTR(error);
14691465
}
14701466
}
14711467
}

0 commit comments

Comments
 (0)