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

format-text: ensure aligment is not 0

Make sure this path of code is not used for alignment == 0,
to prevent division by 0.
This commit is contained in:
Zdenek Kabelac 2013-11-24 19:00:53 +01:00
parent 5a4137c804
commit 01c438a96c
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
Check for non-zero aligment in _text_pv_add_metadata_area() to not div by 0.
Add allocation/use_blkid_wiping to lvm.conf to enable blkid wiping.
Add configure --enable-blkid_wiping to use libblkid to detect signatures.
Add -W/--wipesignatures lvcreate option to support wiping on new LVs.

View File

@ -2083,7 +2083,7 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt,
* alignment since it would be useless.
* Check first whether we can apply that!
*/
if (!pe_start_locked &&
if (!pe_start_locked && alignment &&
((limit - mda_start) > alignment * 2)) {
mda_size = limit - mda_start - alignment * 2;