* [PATCH] sd: remove command-size switching code
@ 2008-09-25 19:03 Alan Stern
0 siblings, 0 replies; 3+ messages in thread
From: Alan Stern @ 2008-09-25 19:03 UTC (permalink / raw)
To: James Bottomley; +Cc: Boaz Harrosh, SCSI development list
This patch (as1138) removes from sd.c some old code for switching from
10-byte commands to 6-byte commands. This code is redundant -- the
switching for READ and WRITE is already handled in
scsi_io_completion() and the switching for MODE SENSE is already
handled in scsi_mode_sense(). (There is no comparable switch for MODE
SELECT, but I doubt one is needed.)
Furthermore the other handlers do a better job; they check for
appropriate ASC and ASCQ values before blindly switching the size.
The code in sd.c is known to cause problems with some devices by
switching when it shouldn't.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
---
What is the point of that strange test against scsi_device_protection?
It's not present in the comparable part of scsi_io_completion().
Index: usb-2.6/drivers/scsi/sd.c
===================================================================
--- usb-2.6.orig/drivers/scsi/sd.c
+++ usb-2.6/drivers/scsi/sd.c
@@ -1069,15 +1069,6 @@ static int sd_done(struct scsi_cmnd *SCp
scsi_print_sense("sd", SCpnt);
good_bytes = sd_completed_bytes(SCpnt);
}
- if (!scsi_device_protection(SCpnt->device) &&
- SCpnt->device->use_10_for_rw &&
- (SCpnt->cmnd[0] == READ_10 ||
- SCpnt->cmnd[0] == WRITE_10))
- SCpnt->device->use_10_for_rw = 0;
- if (SCpnt->device->use_10_for_ms &&
- (SCpnt->cmnd[0] == MODE_SENSE_10 ||
- SCpnt->cmnd[0] == MODE_SELECT_10))
- SCpnt->device->use_10_for_ms = 0;
break;
default:
break;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] sd: remove command-size switching code
@ 2008-10-10 20:03 Alan Stern
2008-10-10 20:10 ` Matthew Wilcox
0 siblings, 1 reply; 3+ messages in thread
From: Alan Stern @ 2008-10-10 20:03 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI development list
[Resending because of lack of response to original posting two weeks
ago.]
This patch (as1138) removes from sd.c some old code for switching from
10-byte commands to 6-byte commands. This code is redundant -- the
switching for READ and WRITE is already handled in
scsi_io_completion() and the switching for MODE SENSE is already
handled in scsi_mode_sense(). (There is no comparable switch for MODE
SELECT, but I doubt one is needed.)
Furthermore the other handlers do a better job; they check for
appropriate ASC and ASCQ values before blindly switching the size.
The code in sd.c is known to cause problems with some devices by
switching when it shouldn't.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
---
Index: usb-2.6/drivers/scsi/sd.c
===================================================================
--- usb-2.6.orig/drivers/scsi/sd.c
+++ usb-2.6/drivers/scsi/sd.c
@@ -1069,15 +1069,6 @@ static int sd_done(struct scsi_cmnd *SCp
scsi_print_sense("sd", SCpnt);
good_bytes = sd_completed_bytes(SCpnt);
}
- if (!scsi_device_protection(SCpnt->device) &&
- SCpnt->device->use_10_for_rw &&
- (SCpnt->cmnd[0] == READ_10 ||
- SCpnt->cmnd[0] == WRITE_10))
- SCpnt->device->use_10_for_rw = 0;
- if (SCpnt->device->use_10_for_ms &&
- (SCpnt->cmnd[0] == MODE_SENSE_10 ||
- SCpnt->cmnd[0] == MODE_SELECT_10))
- SCpnt->device->use_10_for_ms = 0;
break;
default:
break;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sd: remove command-size switching code
2008-10-10 20:03 [PATCH] sd: remove command-size switching code Alan Stern
@ 2008-10-10 20:10 ` Matthew Wilcox
0 siblings, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2008-10-10 20:10 UTC (permalink / raw)
To: Alan Stern; +Cc: James Bottomley, SCSI development list
On Fri, Oct 10, 2008 at 04:03:20PM -0400, Alan Stern wrote:
> This patch (as1138) removes from sd.c some old code for switching from
> 10-byte commands to 6-byte commands. This code is redundant -- the
> switching for READ and WRITE is already handled in
> scsi_io_completion() and the switching for MODE SENSE is already
> handled in scsi_mode_sense(). (There is no comparable switch for MODE
> SELECT, but I doubt one is needed.)
I noticed this odd duplication a few months ago and meant to ask about
it then, but forgot. Thanks for cleaning this up.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-10 20:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-10 20:03 [PATCH] sd: remove command-size switching code Alan Stern
2008-10-10 20:10 ` Matthew Wilcox
-- strict thread matches above, loose matches on Subject: below --
2008-09-25 19:03 Alan Stern
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.