Skip to content

Commit c2ed21a

Browse files
chucklevergregkh
authored andcommitted
NFSD: nfsd_unlink() clobbers non-zero status returned from fh_fill_pre_attrs()
commit d7d8e31 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: 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0f42df0 commit c2ed21a

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
@@ -2011,11 +2011,9 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
20112011
* error status.
20122012
*/
20132013
err = nfserr_file_open;
2014-
} else {
2015-
err = nfserrno(host_err);
20162014
}
20172015
out:
2018-
return err;
2016+
return err != nfs_ok ? err : nfserrno(host_err);
20192017
out_unlock:
20202018
inode_unlock(dirp);
20212019
goto out_drop_write;

0 commit comments

Comments
 (0)