mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-22 17:33:01 +00:00
reconnect_one(): use lookup_one_len_unlocked()
... and explain the non-obvious logics in case when lookup yields a different dentry. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1ae1f3f647
commit
383d4e8ab0
@ -143,14 +143,18 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
|
|||||||
if (err)
|
if (err)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
dprintk("%s: found name: %s\n", __func__, nbuf);
|
dprintk("%s: found name: %s\n", __func__, nbuf);
|
||||||
inode_lock(parent->d_inode);
|
tmp = lookup_one_len_unlocked(nbuf, parent, strlen(nbuf));
|
||||||
tmp = lookup_one_len(nbuf, parent, strlen(nbuf));
|
|
||||||
inode_unlock(parent->d_inode);
|
|
||||||
if (IS_ERR(tmp)) {
|
if (IS_ERR(tmp)) {
|
||||||
dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp));
|
dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp));
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
if (tmp != dentry) {
|
if (tmp != dentry) {
|
||||||
|
/*
|
||||||
|
* Somebody has renamed it since exportfs_get_name();
|
||||||
|
* great, since it could've only been renamed if it
|
||||||
|
* got looked up and thus connected, and it would
|
||||||
|
* remain connected afterwards. We are done.
|
||||||
|
*/
|
||||||
dput(tmp);
|
dput(tmp);
|
||||||
goto out_reconnected;
|
goto out_reconnected;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user