Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Sep 2010 09:01:11 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Rick Macklem <rmacklem@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r212439 - head/sys/fs/nfs
Message-ID:  <20100911060111.GT2465@deviant.kiev.zoral.com.ua>
In-Reply-To: <201009102318.o8ANIjUw098888@svn.freebsd.org>
References:  <201009102318.o8ANIjUw098888@svn.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Fri, Sep 10, 2010 at 11:18:45PM +0000, Rick Macklem wrote:
> 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])
Then, fid_reserved is no more reserved ? Should we rename it ?

Comment for fid_reserved about longword alignment is wrong.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkyLGycACgkQC3+MBN1Mb4i+BQCfTDnOn+fFfFwYt8t66HQ5Wwoh
36cAniK/w2BOdH14x6+Dod7oylOhTmaL
=9613
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100911060111.GT2465>