]> git.michaelhowe.org Git - packages/o/openafs.git/commit
Correct the h_Enumerate_r hostList safety check
authorAndrew Deason <adeason@sinenomine.net>
Fri, 12 Feb 2010 22:30:44 +0000 (16:30 -0600)
committerDerrick Brashear <shadow@dementia.org>
Mon, 22 Feb 2010 19:59:57 +0000 (11:59 -0800)
commit476debff7fc8cb9952155d2d56c01722a5d3192c
tree0483b6c104deb7acfd3de988e0368e834af0c47d
parent89cb6a477b9abc849f60931c47fa9c2ca8339c12
Correct the h_Enumerate_r hostList safety check

Ide1e5aca7c2c4a4af3f62bc07821db694f2f9999 added safety checks for a few
traversals through hostList, including the traversal in h_Enumerate_r.
Unfortunately, h_Enumerate_r may not hold H_LOCK over its entire
traversal (h_Release_r can drop and reacquire it), so the value of
hostCount is not guaranteed to stay the same.

A host may be deleted during the loop, or right near the end, decreasing
hostCount to below our current running 'count' of hosts, triggering the
panic unnecessarily. So instead, remember the value of hostCount.

Reviewed-on: http://gerrit.openafs.org/1304
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 4dfbbd34ce66c09593a0b1a88831ec0f36848fe8)

Change-Id: I8e39d3bbe16e96a1d3f56e3b19d5f30c3810f6bc
Reviewed-on: http://gerrit.openafs.org/1365
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/viced/host.c