recovery: reboot recovery of delegation stateids

recover_client_state() flags all delegations as revoked before starting open state recovery.  if recover_open() finds that its delegation is revoked, it attempts to recover it using CLAIM_PREVIOUS.  if its delegation has already been reclaimed by another open, it can skip reclaiming the open stateid (provided it has no byte-range locks to reclaim).  after all opens have been reclaimed, any delegations still marked 'revoked' are passed to recover_delegation().  recover_delegation() also uses CLAIM_PREVIOUS (or CLAIM_NULL outside of the grace period) to reclaim the delegation, but has to throw away the open stateid with CLOSE

added a try_recovery argument to nfs41_delegreturn() and nfs41_delegation_granted(), so it can be called by recover_open() if OPEN grants an unexpected open

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-07-19 11:04:53 -04:00 committed by unknown
parent 3734527757
commit 4f47ae9a37
7 changed files with 228 additions and 32 deletions

View file

@ -1530,7 +1530,8 @@ out:
int nfs41_delegreturn(
IN nfs41_session *session,
IN nfs41_path_fh *file,
IN stateid4 *stateid)
IN stateid4 *stateid,
IN bool_t try_recovery)
{
int status;
nfs41_compound compound;
@ -1557,7 +1558,7 @@ int nfs41_delegreturn(
compound_add_op(&compound, OP_DELEGRETURN, &dr_args, &dr_res);
dr_args.stateid = stateid;
status = compound_encode_send_decode(session, &compound, TRUE);
status = compound_encode_send_decode(session, &compound, try_recovery);
if (status)
goto out;