Subject: [nfsv4] Question regarding exclusive creates

From: Dave Quigley <[email-masked]>
Date: Wed, 12 Dec 2007 18:08:48 -0500

Hello,

I have been working on a method of "atomically" creating and setting a
label on a new file and it seems that for regular open operations I can
just pass the label in the fattr4 struct in the open arguments. However
this passage regarding exclusive creates concerns me.

   Once the client has performed a successful exclusive create, it must
   issue a SETATTR to set the correct object attributes.  Until it does
   so, it should not rely upon any of the object attributes, since the
   server implementation may need to overload object meta-data to store
   the verifier.  The subsequent SETATTR must not occur in the same
   COMPOUND request as the OPEN.  This separation will guarantee that
   the exclusive create mechanism will continue to function properly in
   the face of retransmission of the request.

Does this mean that if I want to exclusivly create a file I am going to
have to first open the file and then issue a setattr in two separate
compound operations? If so I need to figure out a better way to create
and set the security attribute on the file in one operation since it
needs to be as atomic as possible. I am asking this question here
because it is unclear to me how to solve this without protocol additions
if this is the case.

Dave Quigley

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/nfsv4

---

From: Mike Eisler <[email-masked]>
Date: Wed, 12 Dec 2007 16:02:50 -0800 (PST)

> because it is unclear to me how to solve this without protocol

Under NFSv4.0 this is correct.

In NFSv4.1, a new EXCLUSIVE4_1 arm will be added to allow you to 
set the verifier and attributes atomically. You'll still have to
issue another SETATTR to correct any attributes used for the verifier.
The NFSv4.1 spec recommends against the server using security
attributes
to hold the verifier.

However, neither NFSv4.0 nor NFSv4.1 have a security label attribute,
so your method of using SETATTR won't work until NFSv4.2 at the
earliest, unless you are usurping a bit in the fattr4 bit mask.

---

From: Dave Quigley <[email-masked]>
Date: Thu, 13 Dec 2007 09:30:44 -0500

> earliest, unless you are usurping a bit in the fattr4 bit mask.
That is what we are currently doing for prototyping purposes. We are
still in the process of designing and prototyping so things might change
however using the fattr4 structure to send/receive the security label
seems the best method. I am drawing up the specification document for
our changes and hopefully we can get some feedback regarding the design.
I will keep this in mind while drawing up the document however I will
probably have to revisit it later when we solidify the use of the
verifier in conveying security attribute change on the server.

Dave