mirror of
https://github.com/torvalds/linux.git
synced 2025-08-15 14:11:42 +02:00
exportfs: use lookup_one_unlocked()
rather than locking the directory and using lookup_one(), just use lookup_one_unlocked(). This keeps locking code centralised. Signed-off-by: NeilBrown <neil@brown.name> Link: https://lore.kernel.org/20250608230952.20539-5-neil@brown.name Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
8668a0df07
commit
ce34900389
1 changed files with 1 additions and 3 deletions
|
@ -549,15 +549,13 @@ exportfs_decode_fh_raw(struct vfsmount *mnt, struct fid *fid, int fh_len,
|
||||||
goto err_result;
|
goto err_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inode_lock(target_dir->d_inode);
|
nresult = lookup_one_unlocked(mnt_idmap(mnt), &QSTR(nbuf), target_dir);
|
||||||
nresult = lookup_one(mnt_idmap(mnt), &QSTR(nbuf), target_dir);
|
|
||||||
if (!IS_ERR(nresult)) {
|
if (!IS_ERR(nresult)) {
|
||||||
if (unlikely(nresult->d_inode != result->d_inode)) {
|
if (unlikely(nresult->d_inode != result->d_inode)) {
|
||||||
dput(nresult);
|
dput(nresult);
|
||||||
nresult = ERR_PTR(-ESTALE);
|
nresult = ERR_PTR(-ESTALE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inode_unlock(target_dir->d_inode);
|
|
||||||
/*
|
/*
|
||||||
* At this point we are done with the parent, but it's pinned
|
* At this point we are done with the parent, but it's pinned
|
||||||
* by the child dentry anyway.
|
* by the child dentry anyway.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue