Commit c3e480808685dd13f03af1a8fdda581dcb54d92c

Authored by J. Bruce Fields
1 parent fa0a21269f

nfsd4: don't pretend to support write delegations

The delegation code mostly pretends to support either read or write
delegations.  However, correct support for write delegations would
require, for example, breaking of delegations (and/or implementation of
cb_getattr) on stat.  Currently all that stops us from handing out
delegations is a subtle reference-counting issue.

Avoid confusion by adding an earlier check that explicitly refuses write
delegations.

For now, though, I'm not going so far as to rip out existing
half-support for write delegations, in case we get around to using that
soon.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>

Showing 1 changed file with 7 additions and 0 deletions Side-by-side Diff

... ... @@ -170,6 +170,13 @@
170 170 struct nfs4_cb_conn *cb = &stp->st_stateowner->so_client->cl_cb_conn;
171 171  
172 172 dprintk("NFSD alloc_init_deleg\n");
  173 + /*
  174 + * Major work on the lease subsystem (for example, to support
  175 + * calbacks on stat) will be required before we can support
  176 + * write delegations properly.
  177 + */
  178 + if (type != NFS4_OPEN_DELEGATE_READ)
  179 + return NULL;
173 180 if (fp->fi_had_conflict)
174 181 return NULL;
175 182 if (num_delegations > max_delegations)