5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2024-12-25 23:21:46 +03:00

drbd: use old code to wait for diskless assignment

This commit is contained in:
Dietmar Maurer 2015-06-18 12:21:44 +02:00
parent b0e0ed1abe
commit 9913665327

View File

@ -310,10 +310,16 @@ sub activate_volume {
my $print_warning = 1;
my $max_wait_time = 20;
for (my $i = 0;; $i++) {
($rc, $res) = $hdl->list_assignments([$nodename], [$volname], 0, { "cstate:deploy" => "true" }, []);
check_drbd_res($rc);
my $len = scalar(@$res);
last if $len > 0;
if (1) {
# clumsy, but works
last if system("dd if=$path of=/dev/null bs=512 count=1 >/dev/null 2>&1") == 0;
} else {
# correct, but does not work?
($rc, $res) = $hdl->list_assignments([$nodename], [$volname], 0, { "cstate:deploy" => "true" }, []);
check_drbd_res($rc);
my $len = scalar(@$res);
last if $len > 0;
}
die "aborting wait - device '$path' still not readable\n" if $i > $max_wait_time;
print "waiting for device '$path' to become ready...\n" if $print_warning;
$print_warning = 0;