Skip to contentSkip to conversation

main - debug: better error message

PATCH Zdenek Kabelac 1 participant 1 message Oct 14, 2021

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=af0ce203e9f78e307bfb9524dc8377ebbc53e8f1
Commit:        af0ce203e9f78e307bfb9524dc8377ebbc53e8f1
Parent:        7e346ee2a5cd520fc038dda7451360bbe67e629f
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Oct 14 18:44:55 2021 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200

debug: better error message

Add more details about size difference.

---
 lib/format_text/format-text.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/format_text/format-text.c +3 -1
index 654c387bf..941a34944 100644
@@ -1922,7 +1922,9 @@ static int _text_pv_initialise(const struct format_type *fmt,
 		pv->pe_count = pva->extent_count;
 
 	if ((pv->pe_start + pv->pe_count * (uint64_t)pv->pe_size - 1) > pv->size) {
-		log_error("Physical extents end beyond end of device %s.",
+		log_error("Physical extents (%s) end beyond end of device (%s) %s.",
+			  display_size(pv->fmt->cmd, pv->pe_start + pv->pe_count * (uint64_t)pv->pe_size - 1),
+			  display_size(pv->fmt->cmd, pv->size),
 			  pv_dev_name(pv));
 		return 0;
 	}