Commit c27edfb6 authored by Sumit Saxena's avatar Sumit Saxena Committed by Sasha Levin

scsi: megaraid_sas: fix macro MEGASAS_IS_LOGICAL to avoid regression

[ Upstream commit 5e5ec175 ]

This patch will fix regression caused by commit 1e793f6f ("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: 1e793f6fReported-by: default avatarJens Axboe <axboe@kernel.dk>
CC: stable@vger.kernel.org
Signed-off-by: default avatarKashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Tested-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Tested-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 016d0298
...@@ -1862,7 +1862,7 @@ struct megasas_instance_template { ...@@ -1862,7 +1862,7 @@ struct megasas_instance_template {
}; };
#define MEGASAS_IS_LOGICAL(scp) \ #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(inst, scp) \ #define MEGASAS_DEV_INDEX(inst, scp) \
((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + \ ((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + \
......
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