]> git.michaelhowe.org Git - packages/o/openafs.git/commit
h_TossStuff_r: make sure host does not go away
authorAndrew Deason <adeason@sinenomine.net>
Tue, 16 Feb 2010 17:08:38 +0000 (11:08 -0600)
committerRuss Allbery <rra@debian.org>
Mon, 22 Mar 2010 22:39:39 +0000 (15:39 -0700)
commit15128c3b5bdfa7abda36c148cc80ce09a6b2ba8c
treeeddbd5c75db197cdae9f1fff771e09eeddb82f9c
parent4552de556e3488119ac58deb36ce40939e036be0
h_TossStuff_r: make sure host does not go away

When h_TossStuff_r h_NBLock_r's a host, it is not only possible for
someone else to grab a hold on the host, but in theory it's also
possible for someone to hold a host, release it, and for the host to be
deleted again (assuming some callers hold HOSTDELETED hosts, which they
should not be doing).

To make this safety check a bit more robust, hold the host in
h_TossStuff_r before h_NBLock_r'ing, to ensure that it does not go away
while we're waiting for H_LOCK.

Reviewed-on: http://gerrit.openafs.org/1330
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 380bd77c328d8d83a007cd97f6564fcb5b990a73)

Change-Id: I19d001dba8b0c96b694aefdba2475f0103d33e44
Reviewed-on: http://gerrit.openafs.org/1368
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b78eeb0cca48c65d4466052d207fa22f08a8fa70)
src/viced/host.c
src/viced/host.h