]> git.proxmox.com Git - pve-storage.git/commitdiff
diskmanage: improve setting usage for whole disk with include-partitions
authorFabian Ebner <f.ebner@proxmox.com>
Fri, 16 Apr 2021 10:34:50 +0000 (12:34 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Apr 2021 10:52:08 +0000 (12:52 +0200)
in case a disk with partitions also has an fstype set, which happens for our ZFS
boot disks. Do not change the behavior without include-partitons, as we
prefer(red) to be more specific than simply 'partitions' then.

Reported in the enterprise support channel.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Diskmanage.pm

index 64bb813fdfa59acbb3a1cc5513d8597492ca363d..853d333ddf48cf12ed369661527a3687d70f67cb 100644 (file)
@@ -713,6 +713,9 @@ sub get_disks {
                next if $partitions->{$part}->{used} eq 'partition';
                $used //= $partitions->{$part}->{used};
            }
+       } else {
+           # fstype might be set even if there are partitions, but showing that is confusing
+           $used = 'partitions' if scalar(keys %{$partitions});
        }
        $used //= 'partitions' if scalar(keys %{$partitions});
        # multipath, software raid, etc.