SCSI Tape driver problem

From: vijay srinath (
Date: Mon Jul 30 2001 - 23:40:10 EST

hello all,

    I noticed a bug in the scsi tape class driver in kernel 2.2.16/2.4.x.
This is the test that i ran.
1. I have two scsi-fc tape devices
2. I insert the hba driver, so that both the tape devices are enabled and map to st0 and st1
3. I remove the device that maps to st0 using
   echo "scsi remove-single-device 0 0 0 0" > /proc/scsi/scsi
4. Now, if i try to do an open("/dev/st1",..), the process hangs as the open call never returns.

    The problem seems to be in the callback function st_sleep_done() where the following comparison is being made
if ((st_nbr = TAPE_NR(SCpnt->request.rq_dev)) < st_template.nr_dev)

This comparision fails for the above test since nr_dev will be 1 and
TAPE_NR() will also be 1 for /dev/st1. Hence the semaphore
SCpnt->request.sem never gets released and open waits forever.

    Can somebody please let me know why this comparison is needed ?


Get 250 color business cards for FREE!
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:49 EST