]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix err in size calculation for readdir response.
authorNeil Brown <neilb@cse.unsw.edu.au>
Thu, 21 Nov 2002 06:44:40 +0000 (22:44 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 21 Nov 2002 06:44:40 +0000 (22:44 -0800)
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.

fs/nfsd/nfs3xdr.c
fs/nfsd/nfsxdr.c

index afb96b8c6780e71ff5294caf7188b8ea778c084d..dc7866c5d3ed63fa551a6354e4d450843dc6b3b1 100644 (file)
@@ -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);
index e7dbf29a424f87191f5b8aba260aa55ec6f7b9d5..2a3f9e1638c17691b3dae9b04d5964f2e0d086c5 100644 (file)
@@ -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;
 }