nfs4: reset states to use open_stateid when returning delegation voluntarily
authorJeff Layton <jlayton@poochiereds.net>
Fri, 2 Oct 2015 17:14:37 +0000 (13:14 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 2 Oct 2015 19:43:07 +0000 (15:43 -0400)
commit5e99b532bb95f8e6bf39f4500f0caef070bac16d
treed4b2f5cd9eb4343b2777dee47e2c71a144b6cb22
parente92c1e0d40c50472f80820bd829645ce9fefd6c1
nfs4: reset states to use open_stateid when returning delegation voluntarily

When the client goes to return a delegation, it should always update any
nfs4_state currently set up to use that delegation stateid to instead
use the open stateid. It already does do this in some cases,
particularly in the state recovery code, but not currently when the
delegation is voluntarily returned (e.g. in advance of a RENAME).  This
causes the client to try to continue using the delegation stateid after
the DELEGRETURN, e.g. in LAYOUTGET.

Set the nfs4_state back to using the open stateid in
nfs4_open_delegation_recall, just before clearing the
NFS_DELEGATED_STATE bit.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4proc.c