Commit 34081efc authored by Fred Isaman's avatar Fred Isaman Committed by Linus Torvalds

[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: default avatarFred Isaman <iisaman@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6c26d08f
...@@ -1764,10 +1764,11 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen, ...@@ -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)) if (!(cd->rd_bmval[0] & FATTR4_WORD0_RDATTR_ERROR))
goto fail; goto fail;
nfserr = nfserr_toosmall;
p = nfsd4_encode_rdattr_error(p, buflen, nfserr); p = nfsd4_encode_rdattr_error(p, buflen, nfserr);
if (p == NULL) if (p == NULL) {
nfserr = nfserr_toosmall;
goto fail; goto fail;
}
} }
cd->buflen -= (p - cd->buffer); cd->buflen -= (p - cd->buffer);
cd->buffer = p; cd->buffer = p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment