]> www.infradead.org Git - users/dwmw2/linux.git/commit
NFSD: only call fh_unlock() once in nfsd_link()
authorNeilBrown <neilb@suse.de>
Tue, 26 Jul 2022 06:45:30 +0000 (16:45 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:14 +0000 (16:19 +0200)
commitba4b518a23d3160f09bc310a31a527616bb1a501
tree55c85f4a9df59a38aaf35430c4501f848b7b4938
parentff01da71e484f53abf4c522039517eff322bf667
NFSD: only call fh_unlock() once in nfsd_link()

[ Upstream commit e18bcb33bc5b69bccc2b532075aa00bb49cc01c5 ]

On non-error paths, nfsd_link() calls fh_unlock() twice.  This is safe
because fh_unlock() records that the unlock has been done and doesn't
repeat it.
However it makes the code a little confusing and interferes with changes
that are planned for directory locking.

So rearrange the code to ensure fh_unlock() is called exactly once if
fh_lock() was called.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/vfs.c