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

@ -1632,6 +1632,36 @@ static bool_t decode_op_locku(
}
/*
* OP_DELEGPURGE
*/
static bool_t encode_op_delegpurge(
XDR *xdr,
nfs_argop4 *argop)
{
uint64_t zero = 0;
if (unexpected_op(argop->op, OP_DELEGPURGE))
return FALSE;
/* The client SHOULD set the client field to zero,
* and the server MUST ignore the clientid field. */
return xdr_u_int64_t(xdr, &zero);
}
static bool_t decode_op_delegpurge(
XDR *xdr,
nfs_resop4 *resop)
{
nfs41_delegpurge_res *res = (nfs41_delegpurge_res*)resop->res;
if (unexpected_op(resop->op, OP_DELEGPURGE))
return FALSE;
return xdr_u_int32_t(xdr, &res->status);
}
/*
* OP_DELEGRETURN
*/
@ -3347,7 +3377,7 @@ static const op_table_entry g_op_table[] = {
{ encode_op_close, decode_op_close }, /* OP_CLOSE = 4 */
{ encode_op_commit, decode_op_commit }, /* OP_COMMIT = 5 */
{ encode_op_create, decode_op_create }, /* OP_CREATE = 6 */
{ NULL, NULL }, /* OP_DELEGPURGE = 7 */
{ encode_op_delegpurge, decode_op_delegpurge }, /* OP_DELEGPURGE = 7 */
{ encode_op_delegreturn, decode_op_delegreturn }, /* OP_DELEGRETURN = 8 */
{ encode_op_getattr, decode_op_getattr }, /* OP_GETATTR = 9 */
{ encode_op_getfh, decode_op_getfh }, /* OP_GETFH = 10 */