Re: Possible NFS client 2.2.9 kernel bug

Tom Shield (shield@aem.umn.edu)
Sat, 29 May 1999 17:26:53 -0500 (CDT)


On Fri, 28 May 1999, Trond Myklebust wrote:

>
> Rats. A slight '2am code correction factor' managed to sneak its way
> in to the patch I sent you last night. Eof is of course coded in a
> 32bit unsigned, so the correct patch is as appended.
>
> Cheers,
> Trond
>
> --- fs/nfs/nfs2xdr.c-orig Sat Mar 6 23:21:13 1999
> +++ fs/nfs/nfs2xdr.c Fri May 28 02:10:20 1999
> @@ -371,7 +371,7 @@
>
> p = xdr_encode_fhandle(p, args->fh);
> *p++ = htonl(args->cookie);
> - *p++ = htonl(bufsiz); /* see above */
> + *p++ = htonl(bufsiz-4); /* see above */
> req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
>
> /* set up reply iovec */
>

Trond,

Well your patch had no effect. Because you seem to think its a buffer
size issue, which makes sense because the bug goes away with r/wsize =
1024 (and 2048 it turns out) I decided to print out the varous buffer
sizes in the readdir args and res routines. Below are the locations of
the printk's and the output for r/wsize's of 1024, 2048, 4096 and 8192.
Looks strange to me, but that's just a guess, what do you think?

in nfs_xdr_readdirargs()

*p++ = htonl(bufsiz); /* see above */
+
+ dfprintk(VFS, "NFS: bufsiz = %u \n",bufsiz);
+
req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);

/* set up reply iovec */
replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS_readdirres_sz) << 2;
/*
dprintk("RPC: readdirargs: slack is 4 * (%d + %d + %d) = %d\n",
RPC_REPHDRSIZE, auth->au_rslack, NFS_readdirres_sz, replen);
*/
+
+ dfprintk(VFS, "NFS: replen = %u \n",replen);
+

in nfs_xdr_readdirres()

/* Get start and end address of XDR data */
p = (u32 *) iov[1].iov_base;
end = (u32 *) ((u8 *) p + iov[1].iov_len);
+
+ dfprintk(VFS, "NFS: iov_len = %u \n",iov[1].iov_len);
+ dfprintk(VFS, "NFS: res_bufsiz = %u \n",res->bufsiz);

r/wsize = 1024 (do not see bug)

May 29 13:42:00 y2 kernel: NFS: bufsiz = 1024
May 29 13:42:00 y2 kernel: NFS: replen = 28
May 29 13:42:00 y2 kernel: NFS: iov_len = 1024
May 29 13:42:00 y2 kernel: NFS: res_bufsiz = 4096

r/wsize = 2048 (do not see bug)

May 29 13:46:24 y2 kernel: NFS: bufsiz = 2048
May 29 13:46:24 y2 kernel: NFS: replen = 28
May 29 13:46:24 y2 kernel: NFS: iov_len = 2048
May 29 13:46:24 y2 kernel: NFS: res_bufsiz = 4096

r/wsize = 4096 (has bug)

May 29 13:39:34 y2 kernel: NFS: bufsiz = 4096
May 29 13:39:34 y2 kernel: NFS: replen = 28
May 29 13:39:34 y2 kernel: NFS: iov_len = 4096
May 29 13:39:34 y2 kernel: NFS: res_bufsiz = 4096

r/wsize = 8192 (has bug)

May 29 13:45:15 y2 kernel: NFS: bufsiz = 4096
May 29 13:45:15 y2 kernel: NFS: replen = 28
May 29 13:45:15 y2 kernel: NFS: iov_len = 4096
May 29 13:45:15 y2 kernel: NFS: res_bufsiz = 4096

Let me know what to try next.

regards,

Tom Shield
Aerospace Engineering and Mechanics
University of Minnesota
(612) 626-7793
http://www.aem.umn.edu/people/faculty/shield/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/