From: Fred Isaman Date: Thu, 19 Jan 2006 01:43:40 +0000 (-0800) Subject: [PATCH] nfsd4: Fix bug in rdattr_error return X-Git-Tag: Ubuntu-5.10.0-12.13~57353 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=34081efc12aaaa12f20e5b59f3cb98ba6e27fb34;p=mirror_ubuntu-hirsute-kernel.git [PATCH] nfsd4: Fix bug in rdattr_error return Fix bug in rdattr_error return which causes correct error code to be overwritten by nfserr_toosmall. Signed-off-by: Fred Isaman Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 6b743327686c..69d3501173a8 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1764,10 +1764,11 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen, */ if (!(cd->rd_bmval[0] & FATTR4_WORD0_RDATTR_ERROR)) goto fail; - nfserr = nfserr_toosmall; p = nfsd4_encode_rdattr_error(p, buflen, nfserr); - if (p == NULL) + if (p == NULL) { + nfserr = nfserr_toosmall; goto fail; + } } cd->buflen -= (p - cd->buffer); cd->buffer = p;