From: Michael Meffie Date: Thu, 11 Nov 2010 17:17:05 +0000 (-0500) Subject: viced: fix missing host lock in h_Enumerate X-Git-Tag: openafs-stable-1_6_0pre1~35 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d01e8830661a0939215e1d94be73d8b91053133d;p=packages%2Fo%2Fopenafs.git viced: fix missing host lock in h_Enumerate The global host lock must be held over h_Release_r. Fix the the case in h_Enumerate where h_Release_r is called without the global host lock held. Reviewed-on: http://gerrit.openafs.org/3294 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit c8dc68299d47ae4d7f0c9a1354de9ddd37ff86fc) Change-Id: I10ac0ce495f2784ec270ebb50fc92c983cc0308b Reviewed-on: http://gerrit.openafs.org/3295 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/viced/host.c b/src/viced/host.c index e81196c79..c7318f00e 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -1016,7 +1016,9 @@ h_Enumerate(int (*proc) (struct host*, int, void *), void *param) H_UNLOCK; for (i = 0; i < count; i++) { flags[i] = (*proc) (list[i], flags[i], param); + H_LOCK; h_Release_r(list[i]); + H_UNLOCK; /* bail out of the enumeration early */ if (H_ENUMERATE_ISSET_BAIL(flags[i])) break;