diff mbox

[3/3] sd: do not try to spin-up disks for ALUA 'transitioning' state

Message ID 1436341268-91432-4-git-send-email-hare@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Hannes Reinecke July 8, 2015, 7:41 a.m. UTC
If a disk reports an ALUA 'transitioning' state we should not
try to spin up the device.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/sd.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Sagi Grimberg July 8, 2015, 8:41 a.m. UTC | #1
On 7/8/2015 10:41 AM, Hannes Reinecke wrote:
> If a disk reports an ALUA 'transitioning' state we should not
> try to spin up the device.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>   drivers/scsi/sd.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 7c0bdaa..180a6e8 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1801,6 +1801,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)
>   		if (sense_valid && sshdr.sense_key == NOT_READY) {
>   			if (sshdr.asc == 4 && sshdr.ascq == 3)
>   				break;	/* manual intervention required */
> +			if (sshdr.asc == 4 && sshdr.ascq == 0xa)
> +				break;  /* transitioning */
>   			if (sshdr.asc == 4 && sshdr.ascq == 0xb)
>   				break;	/* standby */
>   			if (sshdr.asc == 4 && sshdr.ascq == 0xc)
>


Hi Hannes,

Just nit-picking, but do you think that these four if statements can be
re-organized to condition (asc == 4) once and OR on the rest?
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Reinecke July 8, 2015, 8:46 a.m. UTC | #2
On 07/08/2015 10:41 AM, Sagi Grimberg wrote:
> On 7/8/2015 10:41 AM, Hannes Reinecke wrote:
>> If a disk reports an ALUA 'transitioning' state we should not
>> try to spin up the device.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>> ---
>>   drivers/scsi/sd.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
>> index 7c0bdaa..180a6e8 100644
>> --- a/drivers/scsi/sd.c
>> +++ b/drivers/scsi/sd.c
>> @@ -1801,6 +1801,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)
>>           if (sense_valid && sshdr.sense_key == NOT_READY) {
>>               if (sshdr.asc == 4 && sshdr.ascq == 3)
>>                   break;    /* manual intervention required */
>> +            if (sshdr.asc == 4 && sshdr.ascq == 0xa)
>> +                break;  /* transitioning */
>>               if (sshdr.asc == 4 && sshdr.ascq == 0xb)
>>                   break;    /* standby */
>>               if (sshdr.asc == 4 && sshdr.ascq == 0xc)
>>
> 
> 
> Hi Hannes,
> 
> Just nit-picking, but do you think that these four if statements can be
> re-organized to condition (asc == 4) once and OR on the rest?
Sure they can, I don't mind.
Once we have a general agreement about these patches (hint, hint :-)
I can update it.

Cheers,

Hannes
diff mbox

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 7c0bdaa..180a6e8 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1801,6 +1801,8 @@  sd_spinup_disk(struct scsi_disk *sdkp)
 		if (sense_valid && sshdr.sense_key == NOT_READY) {
 			if (sshdr.asc == 4 && sshdr.ascq == 3)
 				break;	/* manual intervention required */
+			if (sshdr.asc == 4 && sshdr.ascq == 0xa)
+				break;  /* transitioning */
 			if (sshdr.asc == 4 && sshdr.ascq == 0xb)
 				break;	/* standby */
 			if (sshdr.asc == 4 && sshdr.ascq == 0xc)