PATCH: sd.c -- fix for testing WP bit

From: Matthew Dharm (mdharm-kernel@one-eyed-alien.net)
Date: Tue Sep 05 2000 - 16:36:23 EST


Attached is a patch to linux/drivers/scsi/sd.c which fixes the behavior of
the code which tests the WP bit. This patch is generated against
2.4.0-test8-pre4.

Specifically, thsi code fixes the case where the device in question does
not have a page 1 (I found one, this is how I found the bug). Since we're
not really interested in page 1 (we just want the header data), this patch
makes the code request "all pages" (code 0x3f) with an allocation length of
only 8 bytes (the length of the header data).

This works on all devices I have available to test. I see no reason why it
might break other devices.

Linus, please apply.

Matt Dharm

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

Way to go, lava boy. -- Stef to Greg User Friendly, 3/26/1998


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:23 EST