Skip to contentSkip to conversation

master - format_text: Use absolute alignment to calculate metadata usage

PATCH Alasdair Kergon 1 participant 1 message Dec 11, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=053d35de473aafe641f595b1182626ea39fc0ab0
Commit:        053d35de473aafe641f595b1182626ea39fc0ab0
Parent:        2db67a8ea09a6f1073583e135bfb7b66228d3526
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Mon Dec 11 17:14:38 2017 +0000
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Mon Dec 11 17:14:38 2017 +0000

format_text: Use absolute alignment to calculate metadata usage

Currently both start and offset should always be divisible by alignment, so this should have no effect, but a later patch will increase alignment so these variables can no longer be optimised out.

---
 lib/format_text/format-text.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/format_text/format-text.c +1 -1
index 881fd4d..c226131 100644
@@ -1292,7 +1292,7 @@ int vgname_from_mda(const struct format_type *fmt,
 			   (char *)&vgsummary->vgid);
 
 	if (mda_free_sectors) {
-		current_usage = ALIGN_ABSOLUTE(rlocn->size, 0, MDA_ORIGINAL_ALIGNMENT);
+		current_usage = ALIGN_ABSOLUTE(rlocn->size, dev_area->start + rlocn->offset, MDA_ORIGINAL_ALIGNMENT);
 
 		buffer_size = mdah->size - MDA_HEADER_SIZE;