[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH] Show LE range instead of just a starting LE



Attached patch changes the validator error message
to show LE range instead of just a starting LE.

>   LV lv_mlog is used by LV lv:0, but missing ptr from lv to lv_mlog
>   Internal error: LV segments corrupted in lv_mlog.
>   Failed to write intermediate VG metadata.

The '0' in the above 'lv:0' means the starting LE.
The patch changes it to show the range of the LE instead.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
Index: LVM2.work/lib/metadata/merge.c
===================================================================
--- LVM2.work.orig/lib/metadata/merge.c
+++ LVM2.work/lib/metadata/merge.c
@@ -210,17 +210,18 @@ int check_lv_segments(struct logical_vol
 		if (seg->log_lv == lv)
 			seg_found++;
 		if (!seg_found) {
-			log_error("LV %s is used by LV %s:%" PRIu32 ", "
-				  "but missing ptr from %s to %s",
+			log_error("LV %s is used by LV %s:%" PRIu32 "-%" PRIu32
+				  ", but missing ptr from %s to %s",
 				  lv->name, seg->lv->name, seg->le,
+				  seg->le + seg->len - 1,
 				  seg->lv->name, lv->name);
 			r = 0;
 		} else if (seg_found != sl->count) {
 			log_error("Reference count mismatch: LV %s has %d "
-				  "links to LV %s:%" PRIu32
+				  "links to LV %s:%" PRIu32 "-%" PRIu32
 				  ", which has %d links",
-				  lv->name, sl->count,
-				  seg->lv->name, seg->le, seg_found);
+				  lv->name, sl->count, seg->lv->name, seg->le,
+				  seg->le + seg->len - 1, seg_found);
 			r = 0;
 		}
 	}

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]