]> git.proxmox.com Git - pve-container.git/commitdiff
Always determine the size of the volume in volume_rescan
authorFabian Ebner <f.ebner@proxmox.com>
Tue, 3 Dec 2019 08:31:28 +0000 (09:31 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 12 Dec 2019 14:22:40 +0000 (15:22 +0100)
Otherwise there is an issue when resizing a volume with pending changes:
1. Have a running container with a mount point
2. Edit the mount point and change the path
3. Resize the mount point
4. Reboot the container
Result: the old size is written to the config.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Tested-by: Oguz Bektas <o.bektas@proxmox.com>
src/PVE/LXC/Config.pm

index ffc591101fd3d5402e2372ce72cd0e9af3fb563b..760ec239330a9ef010f9cd6207e210309ea74cf5 100644 (file)
@@ -1307,8 +1307,7 @@ sub vmconfig_apply_pending {
 my $rescan_volume = sub {
     my ($storecfg, $mp) = @_;
     eval {
-       $mp->{size} = PVE::Storage::volume_size_info($storecfg, $mp->{volume}, 5)
-           if !defined($mp->{size});
+       $mp->{size} = PVE::Storage::volume_size_info($storecfg, $mp->{volume}, 5);
     };
     warn "Could not rescan volume size - $@\n" if $@;
 };