Re: [PATCH 7/8] don't mangle INQUIRY if cmddt or evpd bits are set

From: Stefan Richter
Date: Wed Feb 08 2006 - 17:33:38 EST


Al Viro wrote:
Date: 1139425740 -0500

sbp2.c mangles INQUIRY response in a way that only applies to standard
inquiry data (i.e. when both cmddt and evpd bits are 0). Leave other cases
alone; e.g. when asking for VPD the length of reply is in byte 3, not 4
and byte 4 is the first byte of device serial number.

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

---


I tested the patch with 8 different SBP-2 bridges, based on 6 or 7 different bridge chips. Works for me.

In fact, not a single one of these bridges is affected by the code change since the additional expression which was added always evaluates true.

...
- switch (SCpnt->cmnd[0]) {
-
- case INQUIRY:
+ if (SCpnt->cmnd[0] == INQUIRY && (SCpnt->cmnd[1] & 3) == 0) {
/*
* Make sure data length is ok. Minimum length is 36 bytes
*/
...

--
Stefan Richter
-=====-=-==- --=- -=---
http://arcgraph.de/sr/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/