mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-06 05:13:18 +00:00
lookup_fast(): clean up the logics around the fallback to non-rcu mode
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
ad1633a151
commit
209a7fb210
14
fs/namei.c
14
fs/namei.c
@ -1558,12 +1558,7 @@ static int lookup_fast(struct nameidata *nd,
|
|||||||
*seqp = seq;
|
*seqp = seq;
|
||||||
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE))
|
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE))
|
||||||
status = d_revalidate(dentry, nd->flags);
|
status = d_revalidate(dentry, nd->flags);
|
||||||
if (unlikely(status <= 0)) {
|
if (likely(status > 0)) {
|
||||||
if (unlazy_walk(nd, dentry, seq))
|
|
||||||
return -ECHILD;
|
|
||||||
if (status == -ECHILD)
|
|
||||||
status = d_revalidate(dentry, nd->flags);
|
|
||||||
} else {
|
|
||||||
/*
|
/*
|
||||||
* Note: do negative dentry check after revalidation in
|
* Note: do negative dentry check after revalidation in
|
||||||
* case that drops it.
|
* case that drops it.
|
||||||
@ -1574,9 +1569,12 @@ static int lookup_fast(struct nameidata *nd,
|
|||||||
path->dentry = dentry;
|
path->dentry = dentry;
|
||||||
if (likely(__follow_mount_rcu(nd, path, inode, seqp)))
|
if (likely(__follow_mount_rcu(nd, path, inode, seqp)))
|
||||||
return 1;
|
return 1;
|
||||||
if (unlazy_walk(nd, dentry, seq))
|
|
||||||
return -ECHILD;
|
|
||||||
}
|
}
|
||||||
|
if (unlazy_walk(nd, dentry, seq))
|
||||||
|
return -ECHILD;
|
||||||
|
if (unlikely(status == -ECHILD))
|
||||||
|
/* we'd been told to redo it in non-rcu mode */
|
||||||
|
status = d_revalidate(dentry, nd->flags);
|
||||||
} else {
|
} else {
|
||||||
dentry = __d_lookup(parent, &nd->last);
|
dentry = __d_lookup(parent, &nd->last);
|
||||||
if (unlikely(!dentry))
|
if (unlikely(!dentry))
|
||||||
|
Loading…
Reference in New Issue
Block a user