]> 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>
Tue, 9 Sep 2025 00:36:44 +0000 (20:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:32:01 +0000 (16:32 +0200)
commit817a962db3f3164c8de726f218ce561ec49c4ad8
treeb01029352ad699b26b2ba880cacab367cb36bd1b
parent913ff520714f049a63682f511b2c19c39af7b367
NFSD: nfsd_unlink() clobbers non-zero status returned from fh_fill_pre_attrs()

[ Upstream commit d7d8e3169b56e7696559a2427c922c0d55debcec ]

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>
[ Slightly different error mapping ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/vfs.c