From b1ce3765d3427caa96c9cb33ec772212531b5031 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. Reviewed-on: http://gerrit.openafs.org/4580 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 9a4e3ade396583d412a85c4e03238d18d5c533ee) Change-Id: I9ec5ed707ef6b726c358fcaa46d81b9ea1a17ce7 Reviewed-on: http://gerrit.openafs.org/4591 Reviewed-by: Derrick Brashear Tested-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 662bf2b49..5a5bc279c 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -2582,10 +2582,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", -- 2.39.5