Skip to contentSkip to conversation

cluster/fence/agents/scsi scsi_reserve

Cluster-devel [email protected] 1 participant 1 message Dec 12, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rohara at sourceware.org 2006-12-12 21:32:55

Modified files:
fence/agents/scsi: scsi_reserve

Log message:
Fix success/failure reporting when registering devices at startup. If our node (key) is already registered with a given device, do not report failure since this is misleading.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/scsi/scsi_reserve.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.4&r2=1.1.2.5

fence/agents/scsi/scsi_reserve +11 -2
@@ -38,6 +38,8 @@
 #
 key=$( gethostip -x $node_name )
 
+###############################################################################
+
 case $1 in
 
 start)
@@ -62,8 +64,14 @@
   if [ $error -eq 0 ]; then
       success
   else
-      failure
-      rval=1
+      # perhaps we are already resgistered
+      #
+      if sg_persist -d $dev -i -k 2>/dev/null | grep -qiE "${key#0}" ; then
+          success
+      else
+          failure
+          rval=1
+      fi
   fi
 
   echo
@@ -108,6 +116,7 @@
 done
 
 rm -f /var/lock/subsys/scsi_reserve
+
 ;;
 
 status)