On Sat, 15 Apr 2000, Kai Makisara wrote:

> On Fri, 14 Apr 2000, Eric Lee Green wrote:
> 
> > Jim Hammack wrote:
> > > How can I read > 32 Kbytes from a generic scsi device?  I am running
> > > kernel 2.2.13 and using a Sony SDT-9000 DAT drive.  I have data tapes
> > > with a 40960 byte block size.  I can read these tapes okay on an SGI
> > > under IRIX 6.5, but under Linux I only get 32K bytes.
> > 
> > That is correct. Linux currently by default only allows a maximum of 32K bytes
> > in fixed-block mode. This has been identified as a problem. 
> > 
...
> Looking at the source of the 2.3.99-pre5 source, it should be easy to fix
> this problem. The following patch compiles but I have not tested it at
> all:
> 
It did not work ;-( The following patch has been tested and seems to work:
--------------------------------------8<-------------------------------------
--- /source/linux-2.3/drivers/scsi/st.c Fri Mar 24 21:44:32 2000
+++ linux-2.3/drivers/scsi/st.c Sat Apr 15 11:18:32 2000
@@ -2238,7 +2238,7 @@
                    (arg & MT_ST_BLKSIZE_MASK) != 0 &&
                    ((arg & MT_ST_BLKSIZE_MASK) < STp->min_block ||
                     (arg & MT_ST_BLKSIZE_MASK) > STp->max_block ||
-                    (arg & MT_ST_BLKSIZE_MASK) > st_buffer_size)) {
+                    (arg & MT_ST_BLKSIZE_MASK) > (STp->buffer)->buffer_size)) {
                        printk(KERN_WARNING "st%d: Illegal block size.\n", dev);
                        return (-EINVAL);
                }
@@ -2853,6 +2853,11 @@
                    mtc.mt_op != MTSETDENSITY && mtc.mt_op != MTWSM &&
                    mtc.mt_op != MTSETDRVBUFFER && mtc.mt_op != MTSETPART)
                        STps->rw = ST_IDLE;     /* Prevent automatic WEOF and fsf */
+
+               if (mtc.mt_op == MTSETBLK && STp->buffer != NULL &&
+                   mtc.mt_count > (STp->buffer)->buffer_size &&
+                   !enlarge_buffer(STp->buffer, mtc.mt_count, STp->restr_dma))
+                       return (-EIO);  /* Buffer resizing for fixed block mode failed 
+*/
 
                if (mtc.mt_op == MTOFFL && STp->door_locked != ST_UNLOCKED)
                        st_int_ioctl(STp, MTUNLOCK, 0); /* Ignore result! */
--------------------------------------8<-------------------------------------

        Kai



-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to