]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
viced: Transfer host ref in h_FindClient_r
authorAndrew Deason <adeason@sinenomine.net>
Wed, 27 Apr 2011 18:51:23 +0000 (13:51 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 3 May 2011 02:18:49 +0000 (19:18 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9a4e3ade396583d412a85c4e03238d18d5c533ee)

Change-Id: I9ec5ed707ef6b726c358fcaa46d81b9ea1a17ce7
Reviewed-on: http://gerrit.openafs.org/4591
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/viced/host.c

index 662bf2b49423ebc22aea14abfc13cf466d90fbac..5a5bc279c233d487ba1233c405fc472c80ccc074 100644 (file)
@@ -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",