diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2025-01-26 16:50:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-10 14:42:06 +0200 |
commit | 83abd7f34a08c1d6730e3a96289e8cbf4b4079ce (patch) | |
tree | fd18dafcba0d31f934975e73b08768b5fc5d63b1 | |
parent | 052a34f093fb940a145493d1438e7abbfe507cdd (diff) | |
download | linux-83abd7f34a08c1d6730e3a96289e8cbf4b4079ce.tar.gz linux-83abd7f34a08c1d6730e3a96289e8cbf4b4079ce.tar.bz2 linux-83abd7f34a08c1d6730e3a96289e8cbf4b4079ce.zip |
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>
-rw-r--r-- | fs/nfsd/vfs.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 29cb7b812d71..2d8e27c225f9 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -2011,11 +2011,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; |