]> sourceware.org Git - lvm2.git/commitdiff
lvresize: fix 32 bit overflow in size calculation 999979404
authorDavid Teigland <teigland@redhat.com>
Mon, 11 Sep 2023 17:18:12 +0000 (12:18 -0500)
committerDavid Teigland <teigland@redhat.com>
Mon, 11 Sep 2023 17:18:12 +0000 (12:18 -0500)
lib/metadata/lv_manip.c

index f9bc3c34e15b24d443edbbbdc650e34edb202a5a..722e41a63759de3289f511fb05eb2a970a72e83e 100644 (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;
This page took 0.042219 seconds and 5 git commands to generate.