]> git.proxmox.com Git - pve-cluster.git/blobdiff - data/PVE/Cluster.pm
cfs_lock: swap checks for specific errors with $got_lock
[pve-cluster.git] / data / PVE / Cluster.pm
index 94db5918efde1c817c7444b992b56fe8784c5410..1dd29b26a7b216a07cd099082b620bf621c22363 100644 (file)
@@ -911,14 +911,9 @@ my $cfs_lock = sub {
 
     alarm(0);
 
-    if ($err && ($err eq "got lock request timeout\n") &&
-       !check_cfs_quorum()){
-       $err = "$msg: no quorum!\n";
-    }
+    $err = "$msg: no quorum!\n" if !$got_lock && !check_cfs_quorum(1);
 
-    if (!$err || $err !~ /^got lock timeout -/) {
-       rmdir $filename; # cfs unlock
-    }
+    rmdir $filename if $got_lock; # if we held the lock always unlock again
 
     if ($err) {
         $@ = $err;