Re: [PATCH] sd.c fixes applied incorectly to 2.4.19-preXX

James Bottomley
2002-04-16T14:03:03Z

gibbs@scsiguy.com said:
> Well, if we really wanted to fix it correctly:
[...]
> The check against 0xF0 is currently "correct" because the code in
> sd.c's rw_intr doesn't know how to deal with anything other than a
> current error (0x70 + valid bit).

I'm not advocating that you fix it correctly. However, if you use the
provided scsi_sense_valid() function it will show up in an easy to recognise
form for someone who later does all of this fixing. We can't go on adding
these band aid fixes to the scsi subsystem with the justification that it's
currently broken in a lot of cases so we don't need to consider them. All
that does is cause the subsystem to diverge further and make the eventual fix
even more difficult and daunting.

What is wrong with:

if (scsi_sense_valid(SCpnt)) { /* Sense data is valid */
/* FIXME: this probably won't work for deferred errors

That way you've used the supplied function and noted the potential problem
case.

James