nfs41_session_renew() error handling

on failure to renew a session, we don't need to free the session (this leads to crashes).  if we simply return the error to compound_encode_send_decode(), we'll fail any subsequent operations on the session, but still be able to unmount and remain stable

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-01-07 12:55:58 -05:00
parent 757b637607
commit 034b2b4ea2

View file

@ -314,23 +314,16 @@ int nfs41_session_renew(
status = reinit_slot_table(&session->table); status = reinit_slot_table(&session->table);
if (status) { if (status) {
eprintf("init_slot_table failed %d\n", status); eprintf("init_slot_table failed %d\n", status);
goto out_err_session; goto out_unlock;
} }
status = nfs41_create_session(session->client, session, FALSE); status = nfs41_create_session(session->client, session, FALSE);
if (status && status != NFS4ERR_STALE_CLIENTID) { if (status) {
eprintf("nfs41_create_session failed %d\n", status); eprintf("nfs41_create_session failed %d\n", status);
status = ERROR_BAD_NET_RESP; goto out_unlock;
goto out_err_slot;
} }
out_unlock:
ReleaseSRWLockExclusive(&session->client->session_lock); ReleaseSRWLockExclusive(&session->client->session_lock);
out:
return status; return status;
out_err_slot:
free_slot_table(&session->table);
out_err_session:
ReleaseSRWLockExclusive(&session->client->session_lock);
free(session);
goto out;
} }
int nfs41_session_set_lease( int nfs41_session_set_lease(