[Linux-cluster] [PATCH] fence_scsi log actual commands

Dax Kelson dkelson at gurulabs.com
Wed Jan 11 19:42:12 UTC 2012


There is a new Linux iSCSI target in the Linux kernel 3.1. Unlike tgt,
it supports SPC-3 compliant persistent reservations so that it can be
used with fence_scsi.

I encountered a bug in the iSCSI target (an easy workaround is
available) and it was very helpful to see the actual commands that
fence_scsi was running.

I now have a fully working 3 node RHEL6.2 cluster with a Fedora 16 iSCSI
target with working SCSI fencing.

Please consider applying this patch so, that if logging is enabled, the
actual command being run will be logged as well.

Dax Kelson
Guru Labs

Workaround details -- the bug should be fixed when the scatterlist
conversion is completed by Andy Grover, but for now modifying the
allocation length used by the sg_persist commands to 512 by adding '-l
512' to the sg_persist command lines is the workaround.

--- fence_scsi.org	2012-01-11 12:27:52.234042483 -0700
+++ fence_scsi	2012-01-10 18:09:34.301813562 -0700
@@ -208,7 +208,7 @@
     # 	log_error ("$self (err=$err)");
     # }
 
-    log_debug ("$self (err=$err)");
+    log_debug ("$self (err=$err cmd=$cmd)");
 
     return ($err);
 }
@@ -245,7 +245,7 @@
     # 	log_error ("$self (err=$err)");
     # }
 
-    log_debug ("$self (err=$err)");
+    log_debug ("$self (err=$err) (cmd=$cmd)");
 
     return ($err);
 }
@@ -265,7 +265,7 @@
     # 	log_error ("$self (err=$err)");
     # }
 
-    log_debug ("$self (err=$err)");
+    log_debug ("$self (err=$err, cmd=$cmd)");
 
     return ($err);
 }
@@ -285,7 +285,7 @@
     # 	log_error ("$self (err=$err)");
     # }
 
-    log_debug ("$self (err=$err)");
+    log_debug ("$self (err=$err cmd=$cmd)");
 
     return ($err);
 }
@@ -305,7 +305,7 @@
     # 	log_error ("$self (err=$err)");
     # }
 
-    log_debug ("$self (err=$err)");
+    log_debug ("$self (err=$err cmd=$cmd)");
 
     return ($err);
 }
@@ -325,7 +325,7 @@
     # 	log_error ("$self (err=$err)");
     # }
 
-    log_debug ("$self (err=$err)");
+    log_debug ("$self (err=$err cmd=$cmd)");
 
     return ($err);
 }
@@ -342,7 +342,7 @@
     ## note that it is not necessarily an error is $err is non-zero,
     ## so just log the device and status and continue.
 
-    log_debug ("$self (dev=$dev, status=$err)");
+    log_debug ("$self (dev=$dev, status=$err, cmd=$cmd)");
 
     return ($err);
 }
@@ -425,7 +425,7 @@
     my $err = ($?>>8);
 
     if ($err != 0) {
-	log_error ("$self (err=$err)");
+	log_error ("$self (err=$err cmd=$cmd)");
     }
 
     # die "[error]: $self\n" if ($?>>8);
@@ -447,7 +447,7 @@
     my $err = ($?>>8);
 
     if ($err != 0) {
-	log_error ("$self (err=$err)");
+	log_error ("$self (err=$err cmd=$cmd)");
     }
 
     # die "[error]: $self\n" if ($?>>8);
@@ -479,7 +479,7 @@
     my $err = ($?>>8);
 
     if ($err != 0) {
-	log_error ("$self (err=$err)");
+	log_error ("$self (err=$err cmd=$cmd)");
     }
 
     # die "[error]: $self\n" if ($?>>8);
@@ -576,7 +576,7 @@
     my $err = ($?>>8);
 
     if ($err != 0) {
-	log_error ("$self (err=$err)");
+	log_error ("$self (err=$err cmd=$cmd)");
     }
 
     # die "[error]: $self\n" if ($?>>8);
@@ -602,7 +602,7 @@
     my $err = ($?>>8);
 
     if ($err != 0) {
-	log_error ("$self (err=$err)");
+	log_error ("$self (err=$err cmd=$cmd)");
     }
 
     # die "[error]: $self\n" if ($?>>8);





More information about the Linux-cluster mailing list