cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: rohara@sourceware.org <rohara@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/scripts scsi_reserve
Date: 12 Jul 2006 16:55:28 -0000	[thread overview]
Message-ID: <20060712165528.21145.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rohara at sourceware.org	2006-07-12 16:55:28

Modified files:
	fence/scripts  : scsi_reserve 

Log message:
	Added success and failure commands in start/stop.
	
	scsi_reserve start - success if we can register with a device.
	scsi_reserve stop  - success if wa can unregister with a device.
	
	Note that we always try to create a reservation for a device in start,
	but we do not care about success/failure. If it fails, it is probably
	because a reservation already exists.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/scripts/scsi_reserve.diff?cvsroot=cluster&r1=1.2&r2=1.3

--- cluster/fence/scripts/scsi_reserve	2006/07/06 16:07:23	1.2
+++ cluster/fence/scripts/scsi_reserve	2006/07/12 16:55:28	1.3
@@ -50,17 +50,29 @@
 #
 for dev in $scsi_devices
 do
+
   echo -n "Registering device: $dev"
+
   for error in 1
   do
     sg_persist -d $dev -o -G -S $key &>/dev/null || break
-    sg_persist -d $dev -o -R -K $key -T 5 &>/dev/null || break
+    # sg_persist -d $dev -o -R -K $key -T 5 &>/dev/null || break
     error=0
   done
-  if [ $error -ne 0 ]; then
+
+  if [ $error -eq 0 ]; then
+      success
+  else
+      failure
       rval=1
   fi
+
   echo
+
+  # attempt to create a reservation
+  #
+  sg_persist -d $dev -o -R -K $key -T 5 &>/dev/null
+
 done
 ;;
 
@@ -75,7 +87,7 @@
 
   if sg_persist -d $dev -i -r 2>/dev/null | grep -qiE "${key#0}" ; then
       echo "Unable to unregister device: $dev"
-      error=0
+      error=1
   else
       echo -n "Unregistering device: $dev"
       for error in 1
@@ -84,9 +96,14 @@
 	error=0
       done
   fi
-  if [ $error -ne 0 ]; then
+
+  if [ $error -eq 0 ]; then
+      success
+  else
+      failure
       rval=1
   fi
+
   echo
 done
 



             reply	other threads:[~2006-07-12 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12 16:55 rohara [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-07-12 22:08 [Cluster-devel] cluster/fence/scripts scsi_reserve rohara
2006-07-06 16:07 rohara
2006-06-29 17:24 rohara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060712165528.21145.qmail@sourceware.org \
    --to=rohara@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).