Deal with broken Tru64 servers that send different fsids (due to sign extensions) by sign extending the received fsid and then doing the comparison. Signed-off-by: Steve Dickson Acked-by: Peter Staubach --- linux-2.6.18.i686/include/linux/nfs_xdr.h.orig 2007-03-05 11:13:35.000000000 -0500 +++ linux-2.6.18.i686/include/linux/nfs_xdr.h 2007-03-05 13:23:00.000000000 -0500 @@ -21,10 +21,26 @@ struct nfs_fsid { /* * Helper for checking equality between 2 fsids. + * Hack Alert: + * Due do broken Tru64 servers sending sign extend + * 32bit fsids in most but _not_ all procedures, + * we need to be a bit clever as well as make an + * assumption when comparing fsids. + * + * If the assumption can be made that the bottom 32 bits + * of an fsids will *always* change when the fsid changes + * then it should be safe to only look at the bottom 32 bits + * during a 64bit comparison. + * + * So by sign extending the fsid we just received (i.e. b->major) + * and then do the comparison, we are still going a 64bit + * comparison but only really "looking at" the bottom 32 bits. */ static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b) { - return a->major == b->major && a->minor == b->minor; + return (a->major == b->major || + a->major == (uint64_t)((int64_t)((int32_t)(b->major & 0xffffffff)))) && + a->minor == b->minor; } struct nfs_fattr {