Commit b1c89a3b authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

Fix while in spinup loop of sd

We must loop on UNIT ATTENTION sense (to clear the condition).  However, the code 
is assuming that a sense condition will always be accompanied by a not good status.
We have several drivers in the tree that return GOOD with DRIVER_SENSE, so make the
loop condition reflect this.
parent 86764f78
......@@ -835,9 +835,10 @@ sd_spinup_disk(struct scsi_disk *sdkp, char *diskname,
the_result = SRpnt->sr_result;
retries++;
} while (retries < 3 && !scsi_status_is_good(the_result)
&& ((driver_byte(the_result) & DRIVER_SENSE)
&& SRpnt->sr_sense_buffer[2] == UNIT_ATTENTION));
} while (retries < 3 &&
(!scsi_status_is_good(the_result) ||
((driver_byte(the_result) & DRIVER_SENSE) &&
SRpnt->sr_sense_buffer[2] == UNIT_ATTENTION)));
/*
* If the drive has indicated to us that it doesn't have
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment