[pve-devel] [PATCH cluster v3 3/4] cfs_lock: always include lockid in error

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Nov 7 15:37:37 CET 2017


---

changes v2 -> v3:
* include lockid in all error messages, not only a few

 data/PVE/Cluster.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm
index 98a8cc3..b699d68 100644
--- a/data/PVE/Cluster.pm
+++ b/data/PVE/Cluster.pm
@@ -875,10 +875,10 @@ my $cfs_lock = sub {
 	mkdir $lockdir;
 
 	if (! -d $lockdir) {
-	    die "$msg: pve cluster filesystem not online.\n";
+	    die "pve cluster filesystem not online.\n";
 	}
 
-	my $timeout_err = sub { die "$msg: got lock request timeout\n"; };
+	my $timeout_err = sub { die "got lock request timeout\n"; };
 	local $SIG{ALRM} = $timeout_err;
 
 	my $start_time = time();
@@ -916,12 +916,12 @@ my $cfs_lock = sub {
 
     alarm(0);
 
-    $err = "$msg: no quorum!\n" if !$got_lock && !check_cfs_quorum(1);
+    $err = "no quorum!\n" if !$got_lock && !check_cfs_quorum(1);
 
     rmdir $filename if $got_lock; # if we held the lock always unlock again
 
     if ($err) {
-        $@ = $err;
+        $@ = "error with cfs lock '$lockid': $err";
         return undef;
     }
 
-- 
2.11.0





More information about the pve-devel mailing list