]> git.proxmox.com Git - pve-container.git/commitdiff
add check to resize disk if current size could not be determined
authorTim Marx <t.marx@proxmox.com>
Thu, 12 Sep 2019 10:56:20 +0000 (12:56 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Oct 2019 19:47:16 +0000 (21:47 +0200)
This check ensures that disks aren't unintentionally shrunken, if the
size is zero due to an underlying problem.

src/PVE/API2/LXC.pm

index 294c7ca041299fa3d50351d2b018ebdb17dc32c2..1b0c7c32c1024f5d8984dc51af370aa1fa10173d 100644 (file)
@@ -1659,6 +1659,9 @@ __PACKAGE__->register_method({
            PVE::Storage::activate_volumes($storage_cfg, [$volid]);
 
            my $size = PVE::Storage::volume_size_info($storage_cfg, $volid, 5);
+
+           die "Size of volume $volid couldn't be determined\n" if (!defined($size));
+
            $newsize += $size if $ext;
            $newsize = int($newsize);