1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-08 09:57:55 +03:00

Use 64bit math

Prevent 32bit overflow and resulting weird error reports when working
with TB sizes..
This commit is contained in:
Zdenek Kabelac 2012-03-05 14:12:57 +00:00
parent 9a988ab420
commit a31a947d49
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.95 - Version 2.02.95 -
================================ ================================
Use 64bit math for verification of thin pool and snapshot chunk size.
Validate udev structures in _insert_udev_dir(). Validate udev structures in _insert_udev_dir().
Scan all devices for lvmetad if 'pvscan --cache' used without device list. Scan all devices for lvmetad if 'pvscan --cache' used without device list.
Populate lvmcache from lvmetad before displaying PVs in pvscan. (2.02.94) Populate lvmcache from lvmetad before displaying PVs in pvscan. (2.02.94)

View File

@ -4239,12 +4239,12 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
} }
if (seg_is_thin_pool(lp) && if (seg_is_thin_pool(lp) &&
(lp->extents * vg->extent_size < lp->chunk_size)) { ((uint64_t)lp->extents * vg->extent_size < lp->chunk_size)) {
log_error("Unable to create thin pool smaller than 1 chunk."); log_error("Unable to create thin pool smaller than 1 chunk.");
return NULL; return NULL;
} }
if (lp->snapshot && !lp->thin && (lp->extents * vg->extent_size < 2 * lp->chunk_size)) { if (lp->snapshot && !lp->thin && ((uint64_t)lp->extents * vg->extent_size < 2 * lp->chunk_size)) {
log_error("Unable to create a snapshot smaller than 2 chunks."); log_error("Unable to create a snapshot smaller than 2 chunks.");
return NULL; return NULL;
} }