Subject: RE: file id alignment
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Gordon Waidhofer <gww@traakan.com>
List: tech-kern
Date: 06/30/2006 17:08:59
IIRC, these are used to form NFS file handles.
NFS clients will bcmp() file handles for various
purposes. It's important for the NFS server to
construct and return identical file handles for
a given file. Zero-filling the padding is necessary.
	-gww


> -----Original Message-----
> From: tech-kern-owner@NetBSD.org [mailto:tech-kern-owner@NetBSD.org]On
> Behalf Of der Mouse
> Sent: Friday, June 30, 2006 4:29 PM
> To: tech-kern@NetBSD.org
> Subject: Re: file id alignment
> 
> 
> > > -	struct tmpfs_fid *tfhp;
> > > +	struct tmpfs_fid tfh;
> 
> > you need to ensure that any padding bytes in tfh are properly
> > initialized.
> 
> Why?  If they're padding bytes, by definition they do not belong to any
> of the struct fields and anything depending on them is broken.  (I
> don't think C promises that padding bytes are copied when you do a
> struct assignment, for example.)
> 
> /~\ The ASCII				der Mouse
> \ / Ribbon Campaign
>  X  Against HTML	       mouse@rodents.montreal.qc.ca
> / \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
> 
>