[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/fence/agents/scsi scsi_reserve



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	rohara sourceware org	2006-12-12 21:32:53

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=RHEL4&r1=1.1.6.5&r2=1.1.6.6

--- cluster/fence/agents/scsi/scsi_reserve	2006/12/08 22:26:12	1.1.6.5
+++ cluster/fence/agents/scsi/scsi_reserve	2006/12/12 21:32:51	1.1.6.6
@@ -52,6 +52,7 @@
 #
 for dev in $scsi_devices
 do
+
   echo -n "Registering device: $dev"
 
   for error in 1
@@ -63,15 +64,22 @@
   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
+
   # create a reservation
   #
   sg_persist -d $dev -o -R -K $key -T 5 &>/dev/null
 
-  echo
 done
 ;;
 
@@ -133,7 +141,6 @@
 	echo $i
     done
 fi
-
 ;;
 
 esac


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]