Lennart Hansen wrote:

> On Thursday 10 May 2001 22:18, John R. Jackson wrote:
> 
>>>> You want to put:
>>>> 
>>>>   eject     1
>>>> 
>>>> in your chg-scsi config file ...
>>> 
>>> Have allready tryed that, but it don't work..
>> 
>> What did it do?  I'd like to see the chg-scsi*debug file that goes along
>> with this.
> 
> 
> I have tryed to use both 1 and 2 on eject, in chg-scsi.conf, nothing works..
> 
> If i use
> $mt -f /dev/nst0 offline 
> followed by 
> $mtx -f /dev/sga first, next... whatever..
> it works
> 
> The debug file, is attached.
> 
>> Just to be clear, are you using the chg-scsi that comes with 2.4.2p2
>> or did you get the one from 2.5 (or something else)?
> 
> 
> I have tryed 2.4.2p2, and the latest cvs..
> 
> -Lennart
> 
> 
We had the same problem here. We found that it was caused by a bug in 
chg-scsi. When the tape gets ejected, the program loops waiting for 
function "SenseHandler" to return with code SENSE_NO_TAPE_ONLINE. The 
generic SCSI version of this function can only return this code if it 
was called with the parameter "flag" set to 2, telling it that the 
device is a tape drive.Unfortunately that parameter is set to 0 when the 
function gets called and returns with code SENSE_RETRY instead. Here 
included is a patch that fixed the problem for us.

/Charles

-- 
Charles Lopes, IT dept., Findel, IEE Luxembourg
Tel: +352 424737-515
Fax: +352 424737-200

--- changer-src/scsi-changer-driver.c~  Wed Oct 25 02:21:15 2000
+++ changer-src/scsi-changer-driver.c   Mon Apr 30 21:30:17 2001
@@ -1469,7 +1469,7 @@
           true = 0;
           break;
         }
-      if (SenseHandler(pTapeDevCtl->fd, 0, (char *)pRequestSense) == 
SENSE_NO_TAPE_ONLINE)
+      if (SenseHandler(pTapeDevCtl->fd, 2, (char *)pRequestSense) == 
+SENSE_NO_TAPE_ONLINE)
         {
           true=0;
           break;
@@ -1551,7 +1551,7 @@
           true = 0;
           break;
         }
-      if (SenseHandler(pTapeDevCtl->fd, 0, (char *)pRequestSense) == 
SENSE_NO_TAPE_ONLINE)
+      if (SenseHandler(pTapeDevCtl->fd, 2, (char *)pRequestSense) == 
+SENSE_NO_TAPE_ONLINE)
         {
           true=0;
           break;
@@ -1627,7 +1627,7 @@
           true = 0;
           break;
         }
-      if (SenseHandler(DeviceFD, 0, (char *)pRequestSense) == SENSE_NO_TAPE_ONLINE)
+      if (SenseHandler(DeviceFD, 2, (char *)pRequestSense) == SENSE_NO_TAPE_ONLINE)
         {
           return(-1);
           break;

Reply via email to