From 9a4e3ade396583d412a85c4e03238d18d5c533ee Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 27 Apr 2011 13:51:23 -0500 Subject: [PATCH] viced: Transfer host ref in h_FindClient_r In h_FindClient_r, we can change which client structure we're dealing with if we find a different client struct in the Rx conn-specific data. We adjust the refcounts for the client structures themselves, but not the associated hosts. While the host structures should be the same most of the time, we are not guaranteed that, so adjust their refcounts as well. Change-Id: I01f447da3dd2dd4306525b99049c4cd7e27f5181 Reviewed-on: http://gerrit.openafs.org/4580 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/viced/host.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/viced/host.c b/src/viced/host.c index 7cf9b76..b1b7d88 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -2563,10 +2563,15 @@ h_FindClient_r(struct rx_connection *tcon) created = 0; } oldClient->refCount++; + + h_Hold_r(oldClient->host); + h_Release_r(client->host); + H_UNLOCK; ObtainWriteLock(&oldClient->lock); H_LOCK; client = oldClient; + host = oldClient->host; } else { ViceLog(0, ("FindClient: deleted client %p(%x) already had " "conn %p (host %s:%d), stolen by client %p(%x)\n", -- 1.9.4