Subject: [nfsv4] NFSv4 unstable file creation

From: Thomas Haynes <[email-masked]>
Date: Thu, 21 Apr 2011 12:18:15 -0500

Trond,

I'm looking at the I-D and I had a question.

Say a client creates a file with a stable_state attribute of
NFS4_UNSTABLE_METADATA. The server agrees and returns
NFS4_UNSTABLE_METADATA for the OPEN.

At some point, another client does either a LOOKUP or a READDIR
on that file. The server then commits the initial metadata to
persistant storage.

Does the server need to communicate this change to the original
client with the write delegation?

Or is the client required to query the stable_state attribute to
determine this? I.e., is there a benefit to not writing the metadata
information twice? Or is there always a write necessary as timestamps
may have changed?

Also, does the following make sense:

   const NFS4_UNSTABLE_PERSISTENT = 0x00000000;
   const NFS4_UNSTABLE_METADATA   = 0x00000001;
   const NFS4_UNSTABLE_DATA       = 0x00000002;
   const NFS4_UNSTABLE_PNFS       = 0x00000004;

To indicate the client wants persistent storage or that the server
has used persistent storage?

Thanks,
Tom

---

From: Trond Myklebust <[email-masked]>
Date: Sat, 23 Apr 2011 15:04:54 -0400

> client with the write delegation?

No. A LOOKUP or READDIR should never cause a delegation recall, and I
see no reason why the client should need to be notified whether or not
the server has synced something to disk. This isn't exactly something
that we do today with ordinary data WRITEs, and I don't see how does
adding metadata to the equation changes that.

> information twice? Or is there always a write necessary as timestamps

COMMIT doesn't change any timestamps today, and shouldn't do so in the
future either. That would be like having fsync() timestamp a file and
that's just wrong according to POSIX.

> has used persistent storage?

I don't know that we need that. The 'stable_state' attribute is a
bitmask, where if a particular bit is unset, then that means that the
corresponding data or metadata is known to be stable on disk. If the bit
is set, then the data may not yet be written to disk, and so either a
LAYOUTCOMMIT and/or a COMMIT may be needed to sync it do disk.

Cheers
  Trond
-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
[email-masked]
www.netapp.com