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:
parent
b0e0ed1abe
commit
9913665327
@ -310,10 +310,16 @@ sub activate_volume {
|
|||||||
my $print_warning = 1;
|
my $print_warning = 1;
|
||||||
my $max_wait_time = 20;
|
my $max_wait_time = 20;
|
||||||
for (my $i = 0;; $i++) {
|
for (my $i = 0;; $i++) {
|
||||||
($rc, $res) = $hdl->list_assignments([$nodename], [$volname], 0, { "cstate:deploy" => "true" }, []);
|
if (1) {
|
||||||
check_drbd_res($rc);
|
# clumsy, but works
|
||||||
my $len = scalar(@$res);
|
last if system("dd if=$path of=/dev/null bs=512 count=1 >/dev/null 2>&1") == 0;
|
||||||
last if $len > 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;
|
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 "waiting for device '$path' to become ready...\n" if $print_warning;
|
||||||
$print_warning = 0;
|
$print_warning = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user