diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-09-12 16:46:51 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-10-13 09:28:57 -0400 |
commit | c82dc88ddaf17112841dd3a6b08352968555ee08 (patch) | |
tree | 6be63f298247641ccec9766e68a5d3a727d8a87d /drivers/scsi/sd.c | |
parent | ea2151b4e142fa2de0319d9dd80413a997bf435a (diff) | |
download | linux-c82dc88ddaf17112841dd3a6b08352968555ee08.tar.bz2 |
[SCSI] scsi_error: fix target reset handling
There's a target reset bug.
This loop:
for (id = 0; id <= shost->max_id; id++) {
Never terminates if shost->max_id is set to ~0, like aic94xx does.
It's also pretty inefficient since you mostly have compact target
numbers, but the max_id can be very high. The best way would be to
sort the recovery list by target id and skip them if they're equal,
but even a worst case O(N^2) traversal is probably OK here, so fix it
by finding the next highest target number (assuming n+1) and
terminating when there isn't one.
Cc: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/sd.c')
0 files changed, 0 insertions, 0 deletions