recovery: support for CLAIM_DELEGATE_PREV, DELEGPURGE

10.2.1. Delegation Recovery (re: client restart/lease expiration)
A server MAY support claim types of CLAIM_DELEGATE_PREV and CLAIM_DELEG_PREV_FH, and if it does, it MUST NOT remove delegations upon a CREATE_SESSION that confirm a client ID created by EXCHANGE_ID.  Instead, the server MUST, for a period of time no less than that of the value of the lease_time attribute, maintain the client's delegations to allow time for the client to send CLAIM_DELEGATE_PREV and/or CLAIM_DELEG_PREV_FH requests.  The server that supports CLAIM_DELEGATE_PREV and/or CLAIM_DELEG_PREV_FH MUST support the DELEGPURGE operation.

if there's a delegation to reclaim, recover_open_no_grace() now tries CLAIM_DELEGATE_PREV (supported by emc server, but not linux) before falling back to CLAIM_NULL
nfs41_client_delegation_recovery() sends DELEGPURGE to indicate that we're finished reclaiming delegations

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-07-20 13:46:36 -04:00 committed by unknown
parent 8e310c5711
commit b9b3b00e76
5 changed files with 96 additions and 4 deletions

View file

@ -101,8 +101,22 @@ static int recover_open_no_grace(
OUT open_delegation4 *delegation)
{
open_claim4 claim;
int status;
/* TODO: try CLAIM_DELEGATE_PREV / CLAIM_DELEG_PREV_FH first */
if (delegate_type != OPEN_DELEGATE_NONE) {
/* attempt out-of-grace recovery with CLAIM_DELEGATE_PREV */
claim.claim = CLAIM_DELEGATE_PREV;
claim.u.deleg_prev.filename = &file->name;
status = nfs41_open(session, parent, file, owner,
&claim, access, deny, OPEN4_NOCREATE, 0, 0, FALSE,
stateid, delegation, NULL);
if (status == NFS4_OK || status == NFS4ERR_BADSESSION)
goto out;
/* server support for CLAIM_DELEGATE_PREV is optional;
* fall back to CLAIM_NULL on errors */
}
/* attempt out-of-grace recovery with CLAIM_NULL */
claim.claim = CLAIM_NULL;
@ -114,9 +128,11 @@ static int recover_open_no_grace(
else if (delegate_type == OPEN_DELEGATE_WRITE)
access |= OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG;
return nfs41_open(session, parent, file, owner,
status = nfs41_open(session, parent, file, owner,
&claim, access, deny, OPEN4_NOCREATE, 0, 0, FALSE,
stateid, delegation, NULL);
out:
return status;
}
static int recover_open(