Subject: [nfsv4] Draft 19 LAYOUTGET handling of loga_minlength

From: [email-masked]
Date: Thu, 21 Feb 2008 16:21:53 -0500

The NFSv41 draft spec version 19 contains the following text
proscribing the server behavior in response to a LAYOUTGET operation.

   The loga_minlength field specifies the minimum length of layout the
   server MUST return.  If this requirement cannot be met, no layout
   must be returned; the error NFS4ERR_BADLAYOUT will be returned.

Much as an exception is made for loga_length when specified as all 1s,
an exception should be made when the client requests a read 
(loga_iomode is LAYOUTIOMODE_READ) layout and loga_offset +
loga_minlength exceeds the eof.  In this case, the server should be
allowed to return a valid layout up to the end of file, instead of
returning NFS4ERR_BADLAYOUT.  I propose that the wording be
changed to:

   The loga_minlength field specifies the minimum length of layout the
   server MUST return.  If this requirement cannot be met, the server
   MUST return the error NFS4ERR_BADLAYOUT without any layout.  One
   exception is allowed, a smaller layout may be returned if
   LAYOUTIOMODE_READ was specified and EOF is encountered.
_______________________________________________
nfsv4 mailing list
[email-masked]
http://www.ietf.org/mailman/listinfo/nfsv4

---

From: Mike Eisler <[email-masked]>
Date: Fri, 22 Feb 2008 08:31:47 -0800 (PST)

I'll assume we have consensus on this.

I also note that another exception is if the resulting 
lo_length would span two or more patterns.

---

From: Mike Eisler <[email-masked]>
Date: Fri, 22 Feb 2008 09:09:36 -0800 (PST)

diffs are attached.

> >    LAYOUTIOMODE_READ was specified and EOF is encountered.
Index: nfsv41_middle_op_layoutget.xml
===================================================================
RCS file: /cvs/stdk/NFSv41/nfsv41_middle_op_layoutget.xml,v
retrieving revision 1.23
diff -u -w -b -r1.23 nfsv41_middle_op_layoutget.xml
--- nfsv41_middle_op_layoutget.xml	14 Feb 2008 20:14:13 -0000	1.23
+++ nfsv41_middle_op_layoutget.xml	22 Feb 2008 17:07:31 -0000
@@ -38,10 +38,38 @@
     </t>
     <t>
       The loga_minlength field specifies the minimum length of
-      layout the server MUST return.
-      If this requirement cannot be met, no layout must be returned; the error
-      NFS4ERR_BADLAYOUT will be returned.
+      layout the server MUST return with two exceptions:
+
+      <list style="numbers">
+
+      <t>
+
+       The argument loga_iomode was set to
+       LAYOUTIOMODE_READ, and loga_offset plus
+       loga_minlength goes past the end of the file.
+
     </t>
+
+      <t>
+
+       The range from loga_offset through loga_offset +
+       loga_minlength - 1 overlaps two or more striping
+       patterns. In which case, logr_layout will
+       contain two or more elements, and the sum of
+       the lo_length fields of each element MUST be at
+       least loga_minlength unless the first exception
+       also applies.
+
+      </t>
+
+      </list>
+
+      If this requirement cannot be met, the server MUST
+      NOT return a layout and the error NFS4ERR_BADLAYOUT
+      MUST be returned.
+
+    </t>
+
     <t>
       The loga_stateid field specifies a valid stateid.
       If a layout is not currently held by the client,
@@ -94,18 +122,18 @@
     </t>
     <t>
       The metadata server may also return a layout with an lo_iomode
-      other than that requested by the client.  If it does so, it must
+      other than that requested by the client.  If it does so, it MUST
       ensure that the lo_iomode is more permissive than the
       loga_iomode requested.  For example, this behavior allows an
       implementation to upgrade read-only requests to read/write
       requests at its discretion, within the limits of the layout type
       specific protocol.  A lo_iomode of either LAYOUTIOMODE4_READ or
-      LAYOUTIOMODE4_RW must be returned.
+      LAYOUTIOMODE4_RW MUST be returned.
     </t>
     <t>
       The logr_return_on_close result field is a directive to return
       the layout before closing the file.  When the server sets this
-      return value to TRUE, it must be prepared to recall the layout
+      return value to TRUE, it MUST be prepared to recall the layout
       in the case the client fails to return the layout before close.
       For the server that knows a layout must be returned before a
       close of the file, this return value can be used to communicate
@@ -141,12 +169,12 @@
     </t>
     <t>
       If the layout for the file is unavailable due to transient
-      conditions, e.g. file sharing prohibits layouts, the server must
+      conditions, e.g. file sharing prohibits layouts, the server MUST
       return NFS4ERR_LAYOUTTRYLATER.
     </t>
     <t>
       If the layout request is rejected due to an overlapping layout
-      recall, the server must return NFS4ERR_RECALLCONFLICT.  See <xref
+      recall, the server MUST return NFS4ERR_RECALLCONFLICT.  See <xref
       target="pnfs_operation_sequencing" /> for details.
     </t>
     <t>
_______________________________________________
nfsv4 mailing list
[email-masked]
http://www.ietf.org/mailman/listinfo/nfsv4

---

From: Mike Eisler <[email-masked]>
Date: Fri, 22 Feb 2008 09:18:02 -0800 (PST)

Also I want to make this change too:

-      request. The lo_length field in each
-      element of logr_layout SHOULD be at least
-      as long as loga_minlength or the server
-      SHOULD reject the request.
+      request.

--- Mike Eisler <[email-masked]> wrote:

> layout
> > > the
> > > Much as an exception is made for loga_length when specified as
> all
> > > 1s,
> layout
> > > the