Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/cache/lvmcache.c

PATCH [email protected] 1 participant 1 message Oct 22, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2009-10-22 17:33:09

Modified files:
. : WHATS_NEW
lib/cache : lvmcache.c

Log message:
Remember to clear 'global lock held during cache refresh' state after use.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1299&r2=1.1300
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.69&r2=1.70

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.54 -
 =====================================
+  Remember to clear 'global lock held during cache refresh' state after use.
   Use udev flags support in LVM.
   Delay announcing mirror monitoring to syslog until initialisation succeeded.
   Handle metadata with unknown segment types more gracefully.
lib/cache/lvmcache.c +8 -1
@@ -52,8 +52,15 @@
 	if (!(_lock_hash = dm_hash_create(128)))
 		return 0;
 
-	if (_vg_global_lock_held)
+	/*
+	 * Reinitialising the cache clears the internal record of
+	 * which locks are held.  The global lock can be held during
+	 * this operation so its state must be restored afterwards.
+	 */
+	if (_vg_global_lock_held) {
 		lvmcache_lock_vgname(VG_GLOBAL, 0);
+		_vg_global_lock_held = 0;
+	}
 
 	return 1;
 }