Fix spurious request sense in error handling
authorJames Bottomley <JBottomley@Parallels.com>
Thu, 26 Jun 2014 01:58:28 +0000 (19:58 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 2 Apr 2015 18:12:26 +0000 (12:12 -0600)
commit3c2ea47f6127cbc631cb2399bea1ed56be3b93e8
tree62c8e6820e6d9939d4fbd54b277fbe2b6671ef80
parent753028af532225ec4dd831f9124076b9b3b5994c
Fix spurious request sense in error handling

We unconditionally execute scsi_eh_get_sense() to make sure all failed
commands that should have sense attached, do.  However, the routine forgets
that some commands, because of the way they fail, will not have any sense code
... we should not bother them with a REQUEST_SENSE command.  Fix this by
testing to see if we actually got a CHECK_CONDITION return and skip asking for
sense if we don't.

Tested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/scsi_error.c