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

lvresize: fix 32 bit overflow in size calculation

This commit is contained in:
David Teigland 2023-09-11 12:18:12 -05:00
parent 2eb34edeba
commit fa49651301

View File

@ -6445,7 +6445,7 @@ static int _fs_reduce(struct cmd_context *cmd, struct logical_volume *lv,
}
/* extent_size units is SECTOR_SIZE (512) */
newsize_bytes_lv = lp->extents * lv->vg->extent_size * SECTOR_SIZE;
newsize_bytes_lv = (uint64_t) lp->extents * lv->vg->extent_size * SECTOR_SIZE;
newsize_bytes_fs = newsize_bytes_lv;
/*
@ -6591,7 +6591,7 @@ static int _fs_extend(struct cmd_context *cmd, struct logical_volume *lv,
*/
/* extent_size units is SECTOR_SIZE (512) */
newsize_bytes_lv = lp->extents * lv->vg->extent_size * SECTOR_SIZE;
newsize_bytes_lv = (uint64_t) lp->extents * lv->vg->extent_size * SECTOR_SIZE;
newsize_bytes_fs = newsize_bytes_lv;
if (fsinfo.needs_crypt) {
newsize_bytes_fs -= fsinfo.crypt_offset_bytes;