From: Douglas Gilbert <dougg@torque.net>
To: Jens Axboe <axboe@suse.de>
Cc: Ralf Oehler <R.Oehler@GDAmbH.com>,
Scsi <linux-scsi@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: one-line-patch against SCSI-Read-Error-BUG()
Date: Tue, 05 Feb 2002 23:40:22 -0500 [thread overview]
Message-ID: <3C60B3B6.B2103C33@torque.net> (raw)
In-Reply-To: <XFMail.20020205153210.R.Oehler@GDAmbH.com> <20020205152434.A16105@suse.de>
Jens Axboe wrote:
>
> On Tue, Feb 05 2002, Ralf Oehler wrote:
> > Hi, List
> >
> > I think, I found a very simple solution for this annoying BUG().
>
> You fail to understand that the BUG triggering indicates that their is a
> BUG _somewhere_ -- the triggered BUG is not the bug itself, of course,
> that would be stupid :-)
>
> > Since at least kernel 2.4.16 there is a BUG() in pci.h,
> > that crashes the kernel on any attempt to read a SCSI-Sector
> > from an erased MO-Medium and on any attempt to read
> > a sector from a SCSI-disk, which returns "Read-Error".
> >
> > There seems to be a thinko in the corresponding code, which
> > does not take into account the case where a SCSI-READ
> > does not return any data because of a "sense code: read error"
> > or a "sense code: blank sector".
> >
> > I simply commented out this BUG() statement (see below)
> > and everything worked well from there on. The BUG()
> > seems to be inadequate.
>
> The BUG is dangerous, because it means mapping DMA to a 0 address (plus
> offset). Naturally there is no way in hell your "fix" will be applied,
> since it a pretty bad bandaid.
>
> A safer solution for you right now would be to just terminate the
> mapping when you encounter this. So something ala
>
> if (!sg[i].page && !sg[i].address)
> return i;
>
> That's not a bug fix either, but at least it's safer than your version.
> Stock kernel won't be patched until the real problem is found, though.
Jens,
The sg driver was tripping that BUG() and I have submitted
a patch for that. However Ralf probably wasn't using sg
to read his MO disk.
There are several uses of "sgpnt[i].address" in scsi_lib.c that
you might like to look at. Can't see any other uses in sd, sr
or the mid level. Another possibility is a missing memset or
explicit NULL initialisation on a scatterlist array.
Doug Gilbert
next prev parent reply other threads:[~2002-02-06 4:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-05 14:32 one-line-patch against SCSI-Read-Error-BUG() Ralf Oehler
2002-02-05 14:24 ` Jens Axboe
2002-02-05 14:52 ` Momchil Velikov
2002-02-05 14:42 ` Jens Axboe
2002-02-06 4:40 ` Douglas Gilbert [this message]
2002-02-05 20:56 ` Alan Cox
2002-02-06 7:32 ` Ralf Oehler
2002-02-06 9:22 ` Helge Hafting
2002-02-05 22:40 ` James Stevenson
2002-02-06 7:36 ` Ralf Oehler
2002-02-07 0:59 ` Patrick Mansfield
2002-02-07 5:10 ` Douglas Gilbert
2002-02-07 7:29 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C60B3B6.B2103C33@torque.net \
--to=dougg@torque.net \
--cc=R.Oehler@GDAmbH.com \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox