[644] in linux-scsi channel archive
Re: 1.3.30 oops
daemon@ATHENA.MIT.EDU (Kai Makisara)
Sat Sep 30 16:51:04 1995
Date: Sat, 30 Sep 1995 16:32:29 +0200
From: Kai Makisara <makisara@abies.metla.fi>
In-Reply-To: Richard Waltham's message of Fri, 29 Sep 1995 19:56:59 GMT
Cc: Richard Waltham <dormouse@farsrobt.demon.co.uk>,
linux-scsi@vger.rutgers.edu
In article <DFonEz.47@farsrobt.demon.co.uk> Richard Waltham <dormouse@farsrobt.demon.co.uk> writes:
Hi,
Couple of problems I've come across running scsi tapes in kernel 1.3.30.
st_options.h set up with ASYNC writes OFF and 2 FILEMARKS, all other options
at the default values, tape devices HP1533a, controller aha1542cf.
Typical tape command causing problem - "tar -cvf /dev/st1 -C /usr ."
1. In VARIABLE and FIXED block mode. The tape goes into an uninterruptible
sleep after writing the closing filemarks. This happens using rewind or
The problem is specific to writing two filemarks when closing file
AND having SCSI adapter driver configured for only one outstanding
command per lun. The driver tries to allocate a command for
backspacing over the second filemark before releasing the command used
for writing filemarks.
...
2. In FIXED mode an OOPS is generated as below, apparently somewhere in the
tape_write routine, caused presumably by the NULL pointer deference. This
appears to happen on the first call to tape_write and after the oops the
The problem is that the SCSI command is "released" in fixed block mode
even if it has not been allocated (the written data fits into the
driver buffer). The same problem seems to be also in st_read.
The patches at the end of this message fix the problems. Note that
these problems are specific to 1.3.30 (I hope the fix will reach Linus
before 1.3.31 :-)
Finally a question - what is ksymoops? I've seen mention of it here and
there and it looks like its something to extract the symbols from System.map
for an oops automatically. Is this right and if so where can I find it?
You can find ksymoops.cc in linux/scripts starting from 1.3.26.
Thanks for the thorough problem report.
Kai
------------------------------8<--------------------------------------------
--- /source/linux/drivers/scsi/st.c Wed Sep 27 22:09:17 1995
+++ linux/drivers/scsi/st.c Sat Sep 30 15:54:57 1995
@@ -684,6 +684,8 @@
if (!SCpnt)
return;
+ SCpnt->request.rq_status = RQ_INACTIVE; /* Mark as not busy */
+
if ((STp->buffer)->last_result_fatal != 0)
printk("st%d: Error on write filemark.\n", dev);
else {
@@ -693,7 +695,6 @@
if (STp->two_fm)
back_over_eof(STp);
}
- SCpnt->request.rq_status = RQ_INACTIVE; /* Mark as not busy */
}
#if DEBUG
@@ -972,7 +973,7 @@
(STp->buffer)->writing,
st_sleep_done, ST_TIMEOUT, MAX_WRITE_RETRIES);
}
- else
+ else if (SCpnt != NULL)
SCpnt->request.rq_status = RQ_INACTIVE; /* Mark as not busy */
STp->at_sm &= (total != 0);
@@ -1192,7 +1193,8 @@
}
else if (STp->eof != ST_NOEOF) {
STp->eof_hit = 1;
- SCpnt->request.rq_status = RQ_INACTIVE; /* Mark as not busy */
+ if (SCpnt != NULL)
+ SCpnt->request.rq_status = RQ_INACTIVE; /* Mark as not busy */
if (total == 0 && STp->eof == ST_FM) {
STp->eof = ST_NOEOF;
STp->drv_block = 0;
@@ -1211,7 +1213,8 @@
} /* for (total = 0; total < count; ) */
- SCpnt->request.rq_status = RQ_INACTIVE; /* Mark as not busy */
+ if (SCpnt != NULL)
+ SCpnt->request.rq_status = RQ_INACTIVE; /* Mark as not busy */
return total;
}