Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/activate/dev_manager.c

PATCH [email protected] 1 participant 1 message Jan 20, 2012

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: snitzer at sourceware.org 2012-01-20 21:56:01

Modified files:
. : WHATS_NEW
lib/activate : dev_manager.c

Log message:
Lookup snapshot usage percent of origin when a snapshot is merging.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2228&r2=1.2229
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.261&r2=1.262

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Lookup snapshot usage percent of origin when a snapshot is merging.
   Update lvdisplay with backward compat. config opt. lvm1_compatible_display.
   Do not report linear segtype for non-striped targets.
   Keep info about creation host and time for each logical volume.
lib/activate/dev_manager.c +9 -2
@@ -742,6 +742,7 @@
 				 const struct logical_volume *lv,
 				 percent_t *percent)
 {
+	const struct logical_volume *snap_lv;
 	char *name;
 	const char *dlid;
 	int fail_if_percent_unsupported = 0;
@@ -761,13 +762,19 @@
 		fail_if_percent_unsupported = 1;
 	}
 
+	if (lv_is_merging_cow(lv)) {
+		/* must check percent of origin for a merging snapshot */
+		snap_lv = origin_from_cow(lv);
+	} else
+		snap_lv = lv;
+
 	/*
 	 * Build a name for the top layer.
 	 */
-	if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, lv->name, NULL)))
+	if (!(name = dm_build_dm_name(dm->mem, snap_lv->vg->name, snap_lv->name, NULL)))
 		return_0;
 
-	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, NULL)))
+	if (!(dlid = build_dm_uuid(dm->mem, snap_lv->lvid.s, NULL)))
 		return_0;
 
 	/*