Commit c4944025 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] Fix err in size calculation for readdir response.

If the 'data' component of a readdir response is
exactly one page (the max allowed) then we currently
only send 0 bytes of it, instead of PAGE_SIZE bytes.
parent 606b4aef
......@@ -760,7 +760,7 @@ nfs3svc_encode_readdirres(struct svc_rqst *rqstp, u32 *p,
p = resp->buffer;
*p++ = 0; /* no more entries */
*p++ = htonl(resp->common.err == nfserr_eof);
rqstp->rq_res.page_len = ((unsigned long)p & ~PAGE_MASK);
rqstp->rq_res.page_len = (((unsigned long)p-1) & ~PAGE_MASK)+1;
return 1;
} else
return xdr_ressize_check(rqstp, p);
......
......@@ -430,7 +430,7 @@ nfssvc_encode_readdirres(struct svc_rqst *rqstp, u32 *p,
p = resp->buffer;
*p++ = 0; /* no more entries */
*p++ = htonl((resp->common.err == nfserr_eof));
rqstp->rq_res.page_len = ((unsigned long)p & ~PAGE_MASK);
rqstp->rq_res.page_len = (((unsigned long)p-1) & ~PAGE_MASK)+1;
return 1;
}
......
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