What is field 'attrset' in struct OPEN4resok designed for ?

J. Bruce Fields bfields at fieldses.org
Mon Jun 8 16:45:53 EDT 2009


On Mon, Jun 08, 2009 at 11:39:16AM -0400, Noveck, Dave wrote:
> > I think the only legimate use of the create attributes in the
> NO_CREATE
> > case is to implement O_TRUNC: so the size attribute can be specified
> and
> > set to 0, but other attributes should be ignored.
> > 
> > But that isn't spelled out in the spec.  The closest I see is:
> >
> > 	When an UNCHECKED create encounters an existing file, the
> >	attributes specified by createattrs are not used, except that
> >	when an size of zero is specified, the existing file is
> >	truncated.
> 
> It doesn't get a 10 on a 0-10 how-clear-is-it scale, but if does imply
> what you specified above.  It says the attributes are not used which
> sounds like "ignored" to me except that specifying a zero for size
> causes a truncate.
> 
> Clearly attributes other than size are ignored.
> 
> And if the attibute size is specified and is not zero, it says the
> attributes are not used.
> 
> I'll give it a 6.

OK!  So I guess the right thing for a server to do on an non-creating
open would be to clear all but the SIZE bit in the returned attribute
bitmap?

(And returning EINVAL in the NOCREATE case with anything other than the
SIZE bit set would also seem reasonable.)

Hm.  On a quick glance, the linux server code doesn't look right here.

--b.


More information about the NFSv4 mailing list