master - format_text: Change metadata alignment from 512 to 4096.
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=78ffa44fc58fba6f4e8d2046798783d7f4f11b41 Commit: 78ffa44fc58fba6f4e8d2046798783d7f4f11b41 Parent: 643df602c7d199c15ba27958e51e61b822a14755 Author: Alasdair G Kergon <[email protected]> AuthorDate: Tue Dec 12 20:57:36 2017 +0000 Committer: Alasdair G Kergon <[email protected]> CommitterDate: Tue Dec 12 20:57:36 2017 +0000
format_text: Change metadata alignment from 512 to 4096.
If there is sufficient space in the metadata area, align the next metadata to a disk offset that is a multiple of 4096 bytes and don't write it circularly. If it doesn't all fit at the end of the metadata area, go back to the start and write it all there contiguously.
If there is insufficient space to use the new stricter rules, revert to the original behaviour, aligning on 512-byte boundaries wrapping around the circular buffer as required.
--- WHATS_NEW | 1 + lib/format_text/format-text.c | 70 ++++++++++++++++++++++++++++++++--------- lib/format_text/layout.h | 1 + 3 files changed, 57 insertions(+), 15 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.177 - ==================================== + Change text format metadata alignment from 512 to 4096 bytes. When writing metadata, consistently skip mdas marked as failed. Refactor and adjust text format metadata alignment calculation. Fix python3 path in lvmdbusd to use value detected by configure.
lib/format_text/format-text.c +55 -15
121 lines not on this page · raw message
lib/format_text/layout.h +1 -0
@@ -103,6 +103,7 @@ struct mda_context {#define LVM2_LABEL "LVM2 001"#define MDA_SIZE_MIN (8 * (unsigned) lvm_getpagesize())#define MDA_ORIGINAL_ALIGNMENT 512/* Original alignment used for start of VG metadata content */ +#define MDA_ALIGNMENT 4096/* Default alignment in bytes since 2.02.177 for start of VG metadata content. */ int vgname_from_mda(const struct format_type *fmt, struct mda_header *mdah, int primary_mda, struct device_area *dev_area, struct lvmcache_vgsummary *vgsummary,