marsadm: fix warning in check_sizes

This commit is contained in:
Thomas Schoebel-Theuer 2023-08-29 11:22:26 +02:00
parent 3c4c1c3c91
commit 299ec5c6bf
1 changed files with 2 additions and 0 deletions

View File

@ -3251,6 +3251,8 @@ sub check_sizes {
my ($res, $peer) = @_; my ($res, $peer) = @_;
my $physical_size = get_link("$mars/resource-$res/actsize-$peer", 2) || return; my $physical_size = get_link("$mars/resource-$res/actsize-$peer", 2) || return;
my $logical_size = get_link("$mars/resource-$res/size", 1); my $logical_size = get_link("$mars/resource-$res/size", 1);
$physical_size = 0 if $physical_size eq "";
$logical_size = 0 if $logical_size eq "";
if (defined($physical_size) && $physical_size < $logical_size) { if (defined($physical_size) && $physical_size < $logical_size) {
lwarn "Physical device on host '$peer' has size $physical_size, which is smaller than the logical resource size $logical_size\n"; lwarn "Physical device on host '$peer' has size $physical_size, which is smaller than the logical resource size $logical_size\n";
ldie "This is too dangerous. It cannot work. Fix it!\n" unless $force; ldie "This is too dangerous. It cannot work. Fix it!\n" unless $force;