David S. Miller 21af8107f2 esp_scsi: Fix tag state corruption when autosensing.
Meelis Roos reports a crash in esp_free_lun_tag() in the presense
of a disk which has died.

The issue is that when we issue an autosense command, we do so by
hijacking the original command that caused the check-condition.

When we do so we clear out the ent->tag[] array when we issue it via
find_and_prep_issuable_command().  This is so that the autosense
command is forced to be issued non-tagged.

That is problematic, because it is the value of ent->tag[] which
determines whether we issued the original scsi command as tagged
vs. non-tagged (see esp_alloc_lun_tag()).

And that, in turn, is what trips up the sanity checks in
esp_free_lun_tag().  That function needs the original ->tag[] values
in order to free up the tag slot properly.

Fix this by remembering the original command's tag values, and
having esp_alloc_lun_tag() and esp_free_lun_tag() use them.

Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-01 18:08:34 -07:00
..
2013-07-26 08:57:56 -04:00
2013-07-18 12:48:40 -07:00
2013-06-27 13:42:16 -04:00
2013-07-02 14:23:01 -07:00
2013-07-23 16:01:28 -07:00
2013-07-10 14:46:40 -07:00
2013-07-26 11:20:10 -07:00
2013-07-26 11:36:12 -07:00
2013-07-02 11:44:19 -07:00
2013-06-28 13:01:40 +02:00
2013-07-22 09:34:46 +08:00
2013-07-26 16:34:00 -07:00
2013-07-24 16:36:41 -06:00
2013-07-23 14:38:20 -07:00
2013-07-31 17:54:24 -07:00
2013-07-10 14:50:58 -07:00
2013-07-31 11:37:43 -07:00