On Wed, 2 Dec 1998, Stefan Monnier wrote:
>
> [ I'm not on this mailing-list, please c the answer, thank you ]
>
[ writing data to tape cut out ]
> ~-1# mt -f /dev/nst0 status
> SCSI 2 tape drive:
> File number=111, block number=0, partition=0.
> Tape block size 1024 bytes. Density code 0x15 (EXB-8500 (RLL 45434 bpi)).
> Soft error count since last status=0
> General status bits on (81010000):
> EOF ONLINE IM_REP_EN
>
> Here we notice that the `mt status' after an append only has `EOF' while
> on 2.0.36 (and previous 2.0.x as well AFAIK) there would be `EOF' *and* `EOD'.
>
> Has it been changed purposefully or accidentally ?
>
I would say accidentally ;-) Handling of the EOM was changed for 2.1 and
the behaviour changed slightly. I don't see any easy way to correct this
problem and it may be wise to leave this until 2.3.
> Another thing:
>
> Right after doing the above, I did (I use kmod):
>
> ~-0# rmmod st
You should not unload the tape module while having tape in the drive! The
status in the driver is lost.
> ~-0# mt -f /dev/nst0 status
> SCSI 2 tape drive:
> File number=0, block number=0, partition=0.
> Tape block size 1024 bytes. Density code 0x15 (EXB-8500 (RLL 45434 bpi)).
> Soft error count since last status=0
> General status bits on (41010000):
> BOT ONLINE IM_REP_EN
>
> This `BOT' is clearly wrong since the tape is still positioned at
> filenumber=111.
>
This exposes a bug in the current driver. If you apply the patch at the
end of this message, you should see the expected behaviour (i.e., the tape
driver has lost all its status information).
Kai
----------------------------------8<-----------------------------------
--- /source/linux/drivers/scsi/st.c Mon Sep 28 21:05:59 1998
+++ linux/drivers/scsi/st.c Thu Dec 3 20:54:34 1998
@@ -707,7 +707,7 @@
STp->density = 0; /* Clear the erroneous "residue" */
STp->write_prot = 0;
STp->block_size = 0;
- STp->ps[0].drv_file = STp->ps[0].drv_block = 0;
+ STp->ps[0].drv_file = STp->ps[0].drv_block = (-1);
STp->partition = STp->new_partition = 0;
STp->door_locked = ST_UNLOCKED;
STp->in_use = 1;
@@ -785,6 +785,7 @@
!enlarge_buffer(STp->buffer, STp->block_size, STp->restr_dma)) {
printk(KERN_NOTICE "st%d: Blocksize %d too large for buffer.\n", dev,
STp->block_size);
+ scsi_release_command(SCpnt);
(STp->buffer)->in_use = 0;
STp->buffer = NULL;
if (scsi_tapes[dev].device->host->hostt->module)
@@ -3414,8 +3415,8 @@
STps->eof = ST_NOEOF;
STps->at_sm = 0;
STps->last_block_valid = FALSE;
- STps->drv_block = 0;
- STps->drv_file = 0;
+ STps->drv_block = (-1);
+ STps->drv_file = (-1);
}
tpnt->current_mode = 0;
----------------------------------8<-----------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]