Subject: [nfsv4] bulk CB_LAYOUTRECALL inconsistencies

From: Fred Isaman <[email-masked]>
Date: Tue, 23 Nov 2010 20:32:43 -0500

There is a clora_iomode argument to CB_LAYOUTRECALL that, despite
hints in the text and the fact that it is outside of the FILE/FSID/ALL
switch, is unusable with bulk recalls.

It is made unusable by the stateid restrictions from 12.5.5.2.1.5,
which seem to assume all bulk recalls use iomode ANY:

   Once a CB_LAYOUTRECALL of LAYOUTRECALL4_ALL is sent, the server MUST
   NOT allow the client to use any layout stateid except for
   LAYOUTCOMMIT operations.  Once the client receives a CB_LAYOUTRECALL
   of LAYOUTRECALL4_ALL, it MUST NOT use any layout stateid except for
   LAYOUTCOMMIT operations.  Once a LAYOUTRETURN of LAYOUTRETURN4_ALL is
   sent, all layout stateids granted to the client ID are freed.  The
   client MUST NOT use the layout stateids again.  It MUST use LAYOUTGET
   to obtain new layout stateids.

   Once a CB_LAYOUTRECALL of LAYOUTRECALL4_FSID is sent, the server MUST
   NOT allow the client to use any layout stateid that refers to a file
   with the specified fsid except for LAYOUTCOMMIT operations.  Once the
   client receives a CB_LAYOUTRECALL of LAYOUTRECALL4_ALL, it MUST NOT
   use any layout stateid that refers to a file with the specified fsid
   except for LAYOUTCOMMIT operations.  Once a LAYOUTRETURN of
   LAYOUTRETURN4_FSID is sent, all layout stateids granted to the
   referenced fsid are freed.  The client MUST NOT use those freed
   layout stateids for files with the referenced fsid again.
   Subsequently, for any file with the referenced fsid, to use a layout,
   the client MUST first send a LAYOUTGET operation in order to obtain a
   new layout stateid for that file.

This is despite the text from 12.5.5:
   Generally, the
   iomode in the recall request must match the layout being returned;
   for example, a recall with an iomode of LAYOUTIOMODE4_RW should cause
   the client to only return LAYOUTIOMODE4_RW layouts and not
   LAYOUTIOMODE4_READ layouts.

A more minor issue: the "e.g." from 18.44.4 should be removed:
   Note that it is possible that while a
   client is returning the layout for some recalled range, the server
   may recall a superset of that range (e.g., LAYOUTRECALL4_ALL)

as it is made impossible by 12.5.5.2.1.5. :
   The server MUST NOT initiate
   bulk recall while another recall is in progress, or the corresponding
   LAYOUTRETURN is in progress or pending.

Fred