From ce3490038971a205ca12ecadf0d67ef045fad508 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 9 Jun 2025 09:09:36 +1000 Subject: [PATCH] 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 Link: https://lore.kernel.org/20250608230952.20539-5-neil@brown.name Reviewed-by: Chuck Lever Reviewed-by: Jeff Layton Signed-off-by: Christian Brauner --- fs/exportfs/expfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index cdefea17986a9..d3e55de4a2a2a 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c @@ -549,15 +549,13 @@ exportfs_decode_fh_raw(struct vfsmount *mnt, struct fid *fid, int fh_len, goto err_result; } - inode_lock(target_dir->d_inode); - nresult = lookup_one(mnt_idmap(mnt), &QSTR(nbuf), target_dir); + nresult = lookup_one_unlocked(mnt_idmap(mnt), &QSTR(nbuf), target_dir); if (!IS_ERR(nresult)) { if (unlikely(nresult->d_inode != result->d_inode)) { dput(nresult); nresult = ERR_PTR(-ESTALE); } } - inode_unlock(target_dir->d_inode); /* * At this point we are done with the parent, but it's pinned * by the child dentry anyway. -- 2.47.2