From owner-svn-src-head@FreeBSD.ORG Fri Sep 10 23:18:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12629106564A; Fri, 10 Sep 2010 23:18:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01B6B8FC15; Fri, 10 Sep 2010 23:18:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8ANIj0c098890; Fri, 10 Sep 2010 23:18:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8ANIjUw098888; Fri, 10 Sep 2010 23:18:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201009102318.o8ANIjUw098888@svn.freebsd.org> From: Rick Macklem Date: Fri, 10 Sep 2010 23:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212439 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2010 23:18:46 -0000 Author: rmacklem Date: Fri Sep 10 23:18:45 2010 New Revision: 212439 URL: http://svn.freebsd.org/changeset/base/212439 Log: 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 Modified: head/sys/fs/nfs/nfsdport.h Modified: head/sys/fs/nfs/nfsdport.h ============================================================================== --- head/sys/fs/nfs/nfsdport.h Fri Sep 10 23:15:05 2010 (r212438) +++ head/sys/fs/nfs/nfsdport.h Fri Sep 10 23:18:45 2010 (r212439) @@ -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])