Skip to content

Commit d7d8e31

Browse files
committed
NFSD: nfsd_unlink() clobbers non-zero status returned from fh_fill_pre_attrs()
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: a332018 ("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>
1 parent 904201c commit d7d8e31

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

fs/nfsd/vfs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,11 +2010,9 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
20102010
* error status.
20112011
*/
20122012
err = nfserr_file_open;
2013-
} else {
2014-
err = nfserrno(host_err);
20152013
}
20162014
out:
2017-
return err;
2015+
return err != nfs_ok ? err : nfserrno(host_err);
20182016
out_unlock:
20192017
inode_unlock(dirp);
20202018
goto out_drop_write;

0 commit comments

Comments
 (0)