summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2010-09-10 23:18:45 +0000
committerrmacklem <rmacklem@FreeBSD.org>2010-09-10 23:18:45 +0000
commita7e4e69d1930e504dce49aa6b4a2e0131322071e (patch)
tree441497bc38575466f4624f822b16d65291420d8c
parent3ec13fa00231bc74beb3188ad41dde559a363715 (diff)
downloadFreeBSD-src-a7e4e69d1930e504dce49aa6b4a2e0131322071e.zip
FreeBSD-src-a7e4e69d1930e504dce49aa6b4a2e0131322071e.tar.gz
Fix the NFSVNO_CMPFH() macro in the experimental NFS server so
that it works correctly for ZFS file handles. It is possible to have two ZFS file handles that differ only in the bytes in the fid_reserved field of the generic "struct fid" and comparing the bytes in fid_data didn't catch this case. This patch changes the macro to compare all bytes of "struct fid". Tested by: gull at gull.us MFC after: 2 weeks
-rw-r--r--sys/fs/nfs/nfsdport.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/fs/nfs/nfsdport.h b/sys/fs/nfs/nfsdport.h
index 42dbe08..fdba916 100644
--- a/sys/fs/nfs/nfsdport.h
+++ b/sys/fs/nfs/nfsdport.h
@@ -70,8 +70,7 @@ struct nfsexstuff {
#define NFSVNO_CMPFH(f1, f2) \
((f1)->fh_fsid.val[0] == (f2)->fh_fsid.val[0] && \
(f1)->fh_fsid.val[1] == (f2)->fh_fsid.val[1] && \
- !bcmp((f1)->fh_fid.fid_data, (f2)->fh_fid.fid_data, \
- (f1)->fh_fid.fid_len))
+ bcmp(&(f1)->fh_fid, &(f2)->fh_fid, sizeof(struct fid)) == 0)
#define NFSLOCKHASH(f) \
(&nfslockhash[(*((u_int32_t *)((f)->fh_fid.fid_data))) % NFSLOCKHASHSIZE])
OpenPOWER on IntegriCloud