• Jamie Lokier's avatar
    [PATCH] Fix protocol bugs with NFS and nanoseconds · 95e8022b
    Jamie Lokier authored
    NFS with 2.5.75 as both client and server is broken with GNU Make.
    
    The nanosecond field of timestamps of newly touched files is often
    negative on the client, which is probably why Make fails.  The value
    also bears no relation to the file's nanosecond field on the server.
    
    The culprit is htons() used where htonl() should be:
    
    -	*p++ = htonl((u32) time->tv_sec); *p++ = htons(time->tv_nsec);
    +	*p++ = htonl((u32) time->tv_sec); *p++ = htonl(time->tv_nsec);
    
    The rest of this patch corrects nfsd to use microseconds in NFSv2, not
    nanoseconds.  (The client already gets this right, but I have
    optimised it slightly to avoid division when possible).
    95e8022b
nfs2xdr.c 16.8 KB