Skip to content

Commit

Permalink
[SCSI] scsi_lib: stricter checks for clearing use_10_for_rw
Browse files Browse the repository at this point in the history
Check the asc and ascq for being "invalid command opcode" as well.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Jens Axboe authored and James Bottomley committed Dec 14, 2005
1 parent 493ff4e commit 26a6801
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
* system where READ CAPACITY failed, we may have read
* past the end of the disk.
*/
if (cmd->device->use_10_for_rw &&
if ((cmd->device->use_10_for_rw &&
sshdr.asc == 0x20 && sshdr.ascq == 0x00) &&
(cmd->cmnd[0] == READ_10 ||
cmd->cmnd[0] == WRITE_10)) {
cmd->device->use_10_for_rw = 0;
Expand Down

0 comments on commit 26a6801

Please sign in to comment.