1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

support 16KB page size

This commit is contained in:
David Teigland 2023-04-07 09:05:07 -05:00
parent b1789b84c3
commit b443eac6ef
3 changed files with 11 additions and 2 deletions

View File

@ -540,6 +540,9 @@ int config_file_read_fd(struct dm_config_tree *cft, struct device *dev, dev_io_r
log_sys_error("read", dev_name(dev));
goto out;
}
if (!sz)
goto out;
}
} else {
if (!dev_read_bytes(dev, offset, size, buf))

View File

@ -119,6 +119,7 @@ int get_default_pvmetadatasize_sectors(void)
* pagesizes:
* 4096 = 8 sectors.
* 8192 = 16 sectors.
* 16384 = 32 sectors.
* 65536 = 128 sectors.
*/
@ -127,6 +128,8 @@ int get_default_pvmetadatasize_sectors(void)
return 2040;
case 8192:
return 2032;
case 16384:
return 2016;
case 65536:
return 1920;
}

View File

@ -1146,7 +1146,10 @@ static int _dump_label_and_pv_header(struct cmd_context *cmd, uint64_t labelsect
* 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)) {
if ((*mda1_offset != 4096) &&
(*mda1_offset != 8192) &&
(*mda1_offset != 16384) &&
(*mda1_offset != 65536)) {
log_print("WARNING: pv_header.disk_locn[%d].offset %llu is unexpected # for first mda",
di, (unsigned long long)*mda1_offset);
}
@ -1273,7 +1276,7 @@ static int _dump_mda_header(struct cmd_context *cmd, struct settings *set,
uint64_t meta_offset = 0; /* bytes */
uint64_t meta_size = 0; /* bytes */
uint32_t meta_checksum = 0;
int mda_num = (mda_offset == 4096) ? 1 : 2;
int mda_num = (mda_offset <= 65536) ? 1 : 2;
int bad = 0;
*checksum0_ret = 0; /* checksum from raw_locn[0] */