Skip to contentSkip to conversation

LVM2/lib/cache lvmcache.c

PATCH [email protected] 1 participant 1 message Jan 11, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: snitzer at sourceware.org 2010-01-11 19:08:18

Modified files:
lib/cache : lvmcache.c

Log message:
Reset _vgs_locked in lvmcache_init()

Upon successful fork(), _become_daemon() must assert that the locks that are currently held belong to the parent, not the child. All of the child's internal state saying 'this process holds a lock' has to be reset.

A proper lvmcache_locking_reset() should follow later.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76

lib/cache/lvmcache.c +7 -0
@@ -39,6 +39,13 @@
 
 int lvmcache_init(void)
 {
+	/*
+	 * FIXME add a proper lvmcache_locking_reset() that
+	 * resets the cache so no previous locks are locked
+	 * - useful for reset_locking()
+	 */
+	_vgs_locked = 0;
+
 	dm_list_init(&_vginfos);
 
 	if (!(_vgname_hash = dm_hash_create(128)))