]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
viced: fix missing host lock in h_Enumerate
authorMichael Meffie <mmeffie@sinenomine.net>
Thu, 11 Nov 2010 17:17:05 +0000 (12:17 -0500)
committerDerrick Brashear <shadow@dementia.org>
Fri, 12 Nov 2010 00:56:13 +0000 (16:56 -0800)
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 <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c8dc68299d47ae4d7f0c9a1354de9ddd37ff86fc)

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

index e81196c794652e82c58314eac8c0919b521e908e..c7318f00eada260924d99a523ec1a832e97fca15 100644 (file)
@@ -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;