]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] NFSv2 READDIR encoding fix
authorJochen Friedrich <jochen@scram.de>
Mon, 13 Jan 2003 04:41:49 +0000 (20:41 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Mon, 13 Jan 2003 04:41:49 +0000 (20:41 -0800)
When mounting a Linux partition with NFSv2, READDIR fills in the last
cookie without properly byte-swapping it.  The following READDIR will
fail, so the NFS client sees a truncated directory.

Fix it thus.

fs/nfsd/nfsproc.c

index 2a53133096683ba6ac16bf2ecba19c8085d9444d..1388b77c86f06d39770c448ad889e987017cc9e5 100644 (file)
@@ -482,7 +482,7 @@ nfsd_proc_readdir(struct svc_rqst *rqstp, struct nfsd_readdirargs *argp,
 
        resp->count = resp->buffer - argp->buffer;
        if (resp->offset)
-               *resp->offset = (u32)offset;
+               *resp->offset = htonl(offset);
 
        fh_put(&argp->fh);
        return nfserr;