public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* SCSI reserve/release
@ 2003-02-27 20:51 Linda Lee
  2003-02-27 22:53 ` Kurt Garloff
  2003-02-27 23:21 ` Doug Ledford
  0 siblings, 2 replies; 4+ messages in thread
From: Linda Lee @ 2003-02-27 20:51 UTC (permalink / raw)
  To: linux-scsi


I'd like to simulate the SCSI-3 Persistent Group
Reservation of Solaris on Linux using Linux
reserve/release mechanism.  My understanding is that
to make reservation on the device on Linux, I can
issue ioctl() with SCSI_IOCTL_SEND_COMMAND along with
SCSI command "RESERVE" as part of the input data. It
is similar for the release mechanism.  Instead of
"RESERVE" command in the ioctl, put "RELEASE" instead.

Regarding the SCSI reset, I can issue ioctl() with
SG_SCSI_RESET.

Is my approach correct?  Does anyone had done this
before?

Thanks,

Linda

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SCSI reserve/release
  2003-02-27 20:51 SCSI reserve/release Linda Lee
@ 2003-02-27 22:53 ` Kurt Garloff
  2003-02-27 23:32   ` Doug Ledford
  2003-02-27 23:21 ` Doug Ledford
  1 sibling, 1 reply; 4+ messages in thread
From: Kurt Garloff @ 2003-02-27 22:53 UTC (permalink / raw)
  To: Linda Lee; +Cc: linux-scsi

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

Hi Linda,

On Thu, Feb 27, 2003 at 12:51:35PM -0800, Linda Lee wrote:
> I'd like to simulate the SCSI-3 Persistent Group
> Reservation of Solaris on Linux using Linux
> reserve/release mechanism.  My understanding is that
> to make reservation on the device on Linux, I can
> issue ioctl() with SCSI_IOCTL_SEND_COMMAND along with
> SCSI command "RESERVE" as part of the input data. It
> is similar for the release mechanism.  Instead of
> "RESERVE" command in the ioctl, put "RELEASE" instead.
> 
> Regarding the SCSI reset, I can issue ioctl() with
> SG_SCSI_RESET.
> 
> Is my approach correct?  Does anyone had done this
> before?

You can do this. But note that you will lose the reservation
on a reset of the SCSI bus which can occur due to error handling
of your box (or another one). As long as the kernel does not
keep track of reservation states (or you invent some notification
mechanism for SCSI resets to user space), you can't handle this
reliably.

Regards,
-- 
Kurt Garloff  <garloff@suse.de>                          Eindhoven, NL
GPG key: See mail header, key servers                 SuSE Labs (Head)
SuSE Linux AG, Nuernberg, DE                            SCSI, Security

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SCSI reserve/release
  2003-02-27 20:51 SCSI reserve/release Linda Lee
  2003-02-27 22:53 ` Kurt Garloff
@ 2003-02-27 23:21 ` Doug Ledford
  1 sibling, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2003-02-27 23:21 UTC (permalink / raw)
  To: Linda Lee; +Cc: linux-scsi

Linda Lee wrote:
> I'd like to simulate the SCSI-3 Persistent Group
> Reservation of Solaris on Linux using Linux
> reserve/release mechanism.  My understanding is that
> to make reservation on the device on Linux, I can
> issue ioctl() with SCSI_IOCTL_SEND_COMMAND along with
> SCSI command "RESERVE" as part of the input data. It
> is similar for the release mechanism.  Instead of
> "RESERVE" command in the ioctl, put "RELEASE" instead.
> 
> Regarding the SCSI reset, I can issue ioctl() with
> SG_SCSI_RESET.
> 
> Is my approach correct?  Does anyone had done this
> before?

I built a small library and a small application that does this on linux. 
  I then handed it off to the HA people in Red Hat.  Don't know where it 
could be found now, but it used to be available as an RPM named 
scsires-0.7-2.i386.rpm and was distributed in the older Red Hat Linux 
7.2 HA solution.  My guess is that a google search on that file name 
will provide a hit somewhere.


-- 
   Doug Ledford <dledford@redhat.com>     919-754-3700 x44233
          Red Hat, Inc.
          1801 Varsity Dr.
          Raleigh, NC 27606



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SCSI reserve/release
  2003-02-27 22:53 ` Kurt Garloff
@ 2003-02-27 23:32   ` Doug Ledford
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2003-02-27 23:32 UTC (permalink / raw)
  To: Kurt Garloff; +Cc: Linda Lee, linux-scsi

Kurt Garloff wrote:

> You can do this. But note that you will lose the reservation
> on a reset of the SCSI bus which can occur due to error handling
> of your box (or another one). As long as the kernel does not
> keep track of reservation states (or you invent some notification
> mechanism for SCSI resets to user space), you can't handle this
> reliably.

That's not entirely true.  The package I posted a note about a few 
minutes ago does in fact handle this via a means of cooperative 
reservation operations.  In other words, you can't do it reliably in a 
hostile environment, but by enacting a few policy rules (which my app 
does) and then adhering to those rules, you can.


-- 
   Doug Ledford <dledford@redhat.com>     919-754-3700 x44233
          Red Hat, Inc.
          1801 Varsity Dr.
          Raleigh, NC 27606



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-02-27 23:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-27 20:51 SCSI reserve/release Linda Lee
2003-02-27 22:53 ` Kurt Garloff
2003-02-27 23:32   ` Doug Ledford
2003-02-27 23:21 ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox