[SCSI] scsi_lib: stricter checks for clearing use_10_for_rw

Check the asc and ascq for being "invalid command opcode" as well.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
Jens Axboe 2005-11-29 21:03:34 +01:00 committed by James Bottomley
parent 493ff4ee7f
commit 26a68019c8
1 changed files with 2 additions and 1 deletions

View File

@ -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;