1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

pvck: fix warning and exit code for non-4k mda1 offset

Print a warning if mda1 is not 4k, 8k or 64k.
Don't exit with an error for any unexpected mda1 offset.
This commit is contained in:
David Teigland 2021-01-19 11:21:20 -06:00
parent 2ec29d0677
commit 74adbec77f

View File

@ -1140,9 +1140,13 @@ static int _dump_label_and_pv_header(struct cmd_context *cmd, uint64_t labelsect
*mda1_offset = xlate64(dlocn->offset);
*mda1_size = xlate64(dlocn->size);
if (*mda1_offset != 4096) {
log_print("CHECK: pv_header.disk_locn[%d].offset expected 4096 # for first mda", di);
bad++;
/*
* mda1 offset is page size from machine that created it,
* warn if it's not one of the expected page sizes.
*/
if ((*mda1_offset != 4096) && (*mda1_offset != 8192) && (*mda1_offset != 65536)) {
log_print("WARNING: pv_header.disk_locn[%d].offset %llu is unexpected # for first mda",
di, (unsigned long long)*mda1_offset);
}
} else {
*mda2_offset = xlate64(dlocn->offset);