Commit 237df83a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] kNFSd: fixes an xdr error by removing the verifier from error return.

From: NeilBrown <neilb@cse.unsw.edu.au>
parent fdaf729d
...@@ -2091,7 +2091,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re ...@@ -2091,7 +2091,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
{ {
int maxcount; int maxcount;
loff_t offset; loff_t offset;
u32 *page; u32 *page, *savep;
ENCODE_HEAD; ENCODE_HEAD;
if (nfserr) if (nfserr)
...@@ -2100,6 +2100,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re ...@@ -2100,6 +2100,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
return nfserr_resource; return nfserr_resource;
RESERVE_SPACE(8); /* verifier */ RESERVE_SPACE(8); /* verifier */
savep = p;
/* XXX: Following NFSv3, we ignore the READDIR verifier for now. */ /* XXX: Following NFSv3, we ignore the READDIR verifier for now. */
WRITE32(0); WRITE32(0);
...@@ -2117,8 +2118,10 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re ...@@ -2117,8 +2118,10 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
* pointer and eof field. * pointer and eof field.
*/ */
maxcount = (maxcount >> 2) - 4; maxcount = (maxcount >> 2) - 4;
if (maxcount < 0) if (maxcount < 0) {
return nfserr_toosmall; nfserr = nfserr_toosmall;
goto err_no_verf;
}
svc_take_page(resp->rqstp); svc_take_page(resp->rqstp);
page = page_address(resp->rqstp->rq_respages[resp->rqstp->rq_resused-1]); page = page_address(resp->rqstp->rq_respages[resp->rqstp->rq_resused-1]);
...@@ -2136,7 +2139,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re ...@@ -2136,7 +2139,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
readdir->buffer == page) readdir->buffer == page)
nfserr = nfserr_toosmall; nfserr = nfserr_toosmall;
if (nfserr) if (nfserr)
return nfserr; goto err_no_verf;
if (readdir->offset) if (readdir->offset)
xdr_encode_hyper(readdir->offset, offset); xdr_encode_hyper(readdir->offset, offset);
...@@ -2156,6 +2159,10 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re ...@@ -2156,6 +2159,10 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
resp->end = resp->p + PAGE_SIZE/4; resp->end = resp->p + PAGE_SIZE/4;
return 0; return 0;
err_no_verf:
p = savep;
ADJUST_ARGS();
return nfserr;
} }
static void static void
......
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