Windows: avoid cm_serverLock refcount leak
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 22 Aug 2011 13:00:47 +0000 (09:00 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Mon, 22 Aug 2011 22:34:16 +0000 (15:34 -0700)
Change-Id: I4e46750de130557b7d4779f83029b69bc28eaf4b
Reviewed-on: http://gerrit.openafs.org/5293
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_volume.c

index d37a70b..c1ee2c3 100644 (file)
@@ -1275,10 +1275,12 @@ cm_CheckOfflineVolumeState(cm_volume_t *volp, cm_vol_state_t *statep, afs_uint32
                 cm_VolumeStatusNotification(volp, statep->ID, statep->state, vl_alldown);
                 statep->state = vl_alldown;
             }
-        } else if (statep->state != vl_alldown) {
+        } else {
             lock_ReleaseRead(&cm_serverLock);
-            cm_VolumeStatusNotification(volp, statep->ID, statep->state, vl_alldown);
-            statep->state = vl_alldown;
+            if (statep->state != vl_alldown) {
+                cm_VolumeStatusNotification(volp, statep->ID, statep->state, vl_alldown);
+                statep->state = vl_alldown;
+            }
         }
     }
 }