After enabling debug printing of nfsd service, the message prints negative values for offsets. 1) Enable nfsd debug messages: echo 16 > /proc/sys/sunrpc/nfsd_debug 2) Write to a file larger than 2GB over NFS at an offset greater than 2GB. nfsd: WRITE(3) 28: 02000001 0000fd00 19150001 19150004 eb8fc414 19150002 8192 bytes at -1122402816 stable The value -1122402816 is 0xBD197E00 and should print as 3172564480. Problem is in fs/nfsd/nfs3proc.c in nfsd3_proc_write(). The dprintk() call uses %ld to print ((nfs3d_writeargs*)argp)->offset which is declared in fs/nfsd/xdr3.h as __u64. So, it's printed as a signed value. BTW: In fs/nfsd/nfs3proc.c, printing of the __u64 offset value in the read, write, and commit structs is *ALL* performed differently! ;-} The nfsd3_proc_commit() function prints using %Lu, casting argp->offset to (unsigned long long) and looks like the most correct way to print the offset. Recommendation: Modify the dprintk() calls in nfsd3_proc_write() and nfsd3_proc_read() to print the argp->offset value using %Lu, casted to (unsigned long long). Found this while doing some NFS troubleshooting. Not a major bug at all but seems easy to fix. Cheers!
Should have mentioned that the "nfsd: WRITE(3)" above is from the output of `dmesg`, in case it's not clear.
Not a client bug. Reassigning to Bruce.
Created attachment 38562 [details] nfsd: fix offset printk's if nfsd3 read/write Thanks, the suggested fix sounds right; applying for 2.6.38.