Skip to content

Commit ce34900

Browse files
neilbrownbrauner
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: Chuck Lever <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 8668a0d commit ce34900

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/exportfs/expfs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,15 +549,13 @@ exportfs_decode_fh_raw(struct vfsmount *mnt, struct fid *fid, int fh_len,
549549
goto err_result;
550550
}
551551

552-
inode_lock(target_dir->d_inode);
553-
nresult = lookup_one(mnt_idmap(mnt), &QSTR(nbuf), target_dir);
552+
nresult = lookup_one_unlocked(mnt_idmap(mnt), &QSTR(nbuf), target_dir);
554553
if (!IS_ERR(nresult)) {
555554
if (unlikely(nresult->d_inode != result->d_inode)) {
556555
dput(nresult);
557556
nresult = ERR_PTR(-ESTALE);
558557
}
559558
}
560-
inode_unlock(target_dir->d_inode);
561559
/*
562560
* At this point we are done with the parent, but it's pinned
563561
* by the child dentry anyway.

0 commit comments

Comments
 (0)