Skip to contentSkip to conversation

LVM2/libdm libdm-deptree.c

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

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2012-01-19 15:22:32

Modified files:
libdm : libdm-deptree.c

Log message:
Thin handle empty thin volume case

Report both values as 0 in case the volume is unused.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.149&r2=1.150

libdm/libdm-deptree.c +4 -1
@@ -3143,7 +3143,10 @@
 		return 0;
 	}
 
-	if (sscanf(params, "%" PRIu64 " %" PRIu64,
+	if (strchr(params, '-')) {
+		s->mapped_sectors = 0;
+		s->highest_mapped_sector = 0;
+	} else if (sscanf(params, "%" PRIu64 " %" PRIu64,
 		   &s->mapped_sectors,
 		   &s->highest_mapped_sector) != 2) {
 		log_error("Failed to parse thin params: %s.", params);