create_session uses compound_encode_send_decode()

send CREATE_SESSION with compound_encode_send_decode() instead of nfs41_send_compound() for its NFS4ERR_DELAY and NFS4ERR_STALE_CLIENTID handling

added 'try_recovery' argument to nfs41_create_session(), which is passed on to compound_encode_send_decode().  nfs41_session_renew() uses try_recovery=FALSE, because it handles the NFS4ERR_STALE_CLIENTID error on its own.  nfs41_session_create() uses try_recovery=TRUE to make use of the NFS4ERR_STALE_CLIENTID error handling.  modified the NFS4ERR_STALE_CLIENTID block to call nfs41_client_renew() and retry the operation (i.e. CREATE_SESSION), instead of falling through to session recovery

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-01-07 11:50:35 -05:00
parent f2095915aa
commit 757b637607
4 changed files with 30 additions and 56 deletions

View file

@ -363,22 +363,21 @@ retry:
if (!recovery_start_or_wait(session->client))
goto do_retry;
//try to create a new client
client_state_lost = TRUE;
status = nfs41_client_renew(session->client);
recovery_finish(session->client);
if (status) {
eprintf("nfs41_exchange_id() failed with %d\n", status);
status = ERROR_BAD_NET_RESP;
recovery_finish(session->client);
goto out;
}
//fallthru and reestablish the session
goto do_retry;
case NFS4ERR_BADSESSION:
if (compound->res.status == NFS4ERR_BADSESSION) {
if (!try_recovery)
goto out;
if (!recovery_start_or_wait(session->client))
goto do_retry;
}
if (!try_recovery)
goto out;
if (!recovery_start_or_wait(session->client))
goto do_retry;
restart_recovery:
//try to create a new session
status = nfs41_session_renew(session);