From c24c79f3cc2e88b1edec46a1bf0ee8b66731c78c Mon Sep 17 00:00:00 2001 From: "U-fast\\aglo" Date: Wed, 15 Jun 2011 11:25:46 -0400 Subject: [PATCH] handling rpc_autherr instead of trying to restablish the rpc client and auth_client for autherr, instead just create a new auth_client. --- daemon/nfs41_rpc.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/daemon/nfs41_rpc.c b/daemon/nfs41_rpc.c index d6e1f4c..d349d04 100644 --- a/daemon/nfs41_rpc.c +++ b/daemon/nfs41_rpc.c @@ -359,7 +359,7 @@ int nfs41_send_compound( case RPC_CANTSEND: case RPC_TIMEDOUT: case RPC_AUTHERROR: - if (!rpc->is_valid_session && ++count > 3) { + if (++count > 3 || !rpc->is_valid_session) { status = ERROR_NETWORK_UNREACHABLE; break; } @@ -377,8 +377,20 @@ int nfs41_send_compound( goto try_again; } rpc_renew_in_progress(rpc, &one); - if (rpc_reconnect(rpc)) - eprintf("rpc_reconnect: Failed to reconnect!\n"); + if (rpc_status == RPC_AUTHERROR && rpc->sec_flavor != RPCSEC_AUTH_SYS) { + AcquireSRWLockExclusive(&rpc->lock); + auth_destroy(rpc->rpc->cl_auth); + status = create_rpcsec_auth_client(rpc->sec_flavor, + rpc->server_name, rpc->rpc); + ReleaseSRWLockExclusive(&rpc->lock); + if (status) { + eprintf("Failed to reestablish security context\n"); + status = ERROR_NETWORK_UNREACHABLE; + goto out; + } + } else + if (rpc_reconnect(rpc)) + eprintf("rpc_reconnect: Failed to reconnect!\n"); rpc_renew_in_progress(rpc, &zero); goto try_again; default: