recovery: remember byte-range locks and reclaim during recovery

nfs41_open_state maintains a list of outstanding byte-range locks by calling open_lock_add() and open_lock_remove() in lock.c

during client state recovery, after reclaiming each OPEN stateid, send LOCK requests with reclaim=TRUE for each lock it owns, and update the open's lock stateid with the result

added 'bool_t reclaim' argument to nfs41_lock(); when set, compound_encode_send_decode() is called with try_recovery=FALSE to avoid recursive recovery

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2010-11-18 15:11:36 -05:00 committed by unknown
parent 1906610544
commit 222c1bf020
7 changed files with 141 additions and 56 deletions

View file

@ -62,6 +62,7 @@ static int create_open_state(
state->owner.owner_len = (uint32_t)strlen(
(const char*)state->owner.owner);
state->ref_count = 1;
list_init(&state->locks.list);
*state_out = state;
status = NO_ERROR;
@ -73,6 +74,18 @@ out_free:
goto out;
}
static void open_state_free(
IN nfs41_open_state *state)
{
struct list_entry *entry, *tmp;
/* free associated lock state */
list_for_each_tmp(entry, tmp, &state->locks.list)
free(list_container(entry, nfs41_lock_state, open_entry));
free(state);
}
/* open state reference counting */
void nfs41_open_state_ref(
IN nfs41_open_state *state)
@ -91,7 +104,7 @@ void nfs41_open_state_deref(
dprintf(2, "nfs41_open_state_deref(%s) count %d\n",
state->path.path, count);
if (count == 0)
free(state);
open_state_free(state);
}
void nfs41_open_stateid_arg(