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

metadata: format_text: check metadata area size is at least MDA_SIZE_MIN

This commit is contained in:
Peter Rajnoha 2015-10-29 15:59:29 +01:00
parent 28e54032c0
commit ccb8da404d
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
Check metadata area size is at least minimum size of 8 * memory page size.
Thin pool targets uses low_water_mark from profile.
Dropping 'yet' from error of unsupported thick snapshot of snapshots.
Do not support unpartitioned DASD devices with CDL formatted with pvcreate.

View File

@ -2146,7 +2146,6 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
goto bad;
}
/* Otherwise, give up and take any usable space. */
/* FIXME: We should probably check for some minimum MDA size here. */
else
mda_size = limit - mda_start;
@ -2242,6 +2241,12 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
FMTu64 ").", pv_dev_name(pv),
mda_size, limit_name, limit);
if (mda_size < MDA_SIZE_MIN) {
log_error("Metadata area size too small. "
"It must be at least %u bytes.", MDA_SIZE_MIN);
goto bad;
}
if (mda_size) {
/* Wipe metadata area with zeroes. */
if (!dev_set((struct device *) pv->dev, mda_start,