]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFSD: nfsd_unlink() clobbers non-zero status returned from fh_fill_pre_attrs()
authorChuck Lever <chuck.lever@oracle.com>
Sun, 26 Jan 2025 21:50:17 +0000 (16:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:40 +0000 (14:39 +0200)
commit101fd0aa0d7d502ea947cdc20abdc9a6e565dea0
treed8d41d37dc676750b5abacaa99c8203f8e55f5f4
parenta84c80515ca8a0cdf6d06f1b6ca721224b08453e
NFSD: nfsd_unlink() clobbers non-zero status returned from fh_fill_pre_attrs()

commit d7d8e3169b56e7696559a2427c922c0d55debcec upstream.

If fh_fill_pre_attrs() returns a non-zero status, the error flow
takes it through out_unlock, which then overwrites the returned
status code with

err = nfserrno(host_err);

Fixes: a332018a91c4 ("nfsd: handle failure to collect pre/post-op attrs more sanely")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/vfs.c