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: a332018a91 ("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>
This commit is contained in:
Chuck Lever
2025-01-26 16:50:17 -05:00
committed by Greg Kroah-Hartman
parent a84c80515c
commit 101fd0aa0d
+1 -3
View File
@@ -2015,11 +2015,9 @@ out_nfserr:
* error status.
*/
err = nfserr_file_open;
} else {
err = nfserrno(host_err);
}
out:
return err;
return err != nfs_ok ? err : nfserrno(host_err);
out_unlock:
inode_unlock(dirp);
goto out_drop_write;