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

From: Matthew Dharm (
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

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: 
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 Please read the FAQ at

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