]> Git Repo - linux.git/commitdiff
scsi: megaraid_sas: fix macro MEGASAS_IS_LOGICAL to avoid regression
authorSumit Saxena <[email protected]>
Wed, 9 Nov 2016 10:59:42 +0000 (02:59 -0800)
committerMartin K. Petersen <[email protected]>
Wed, 9 Nov 2016 16:26:41 +0000 (11:26 -0500)
This patch will fix regression caused by commit 1e793f6fc0db ("scsi:
megaraid_sas: Fix data integrity failure for JBOD (passthrough)
devices").

The problem was that the MEGASAS_IS_LOGICAL macro did not have braces
and as a result the driver ended up exposing a lot of non-existing SCSI
devices (all SCSI commands to channels 1,2,3 were returned as
SUCCESS-DID_OK by driver).

[mkp: clarified patch description]

Fixes: 1e793f6fc0db920400574211c48f9157a37e3945
Reported-by: Jens Axboe <[email protected]>
CC: [email protected]
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Sumit Saxena <[email protected]>
Tested-by: Sumit Saxena <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Tested-by: Jens Axboe <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/scsi/megaraid/megaraid_sas.h

index ca86c885dfaab4f0fb6ae3595922d6f1a77974be..3aaea713bf3712b2ad8874aaecf8a6337b7a2119 100644 (file)
@@ -2233,7 +2233,7 @@ struct megasas_instance_template {
 };
 
 #define MEGASAS_IS_LOGICAL(scp)                                                \
-       (scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1
+       ((scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1)
 
 #define MEGASAS_DEV_INDEX(scp)                                         \
        (((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) +   \
This page took 0.059637 seconds and 4 git commands to generate.