Skip to content

Commit bfa6591

Browse files
cp890582martinkpetersen
authored andcommitted
scsi: megaraid_sas: Update max supported LD IDs to 240
The firmware only supports Logical Disk IDs up to 240 and LD ID 255 (0xFF) is reserved for deleted LDs. However, in some cases, firmware was assigning LD ID 254 (0xFE) to deleted LDs and this was causing the driver to mark the wrong disk as deleted. This in turn caused the wrong disk device to be taken offline by the SCSI midlayer. To address this issue, limit the LD ID range from 255 to 240. This ensures the deleted LD ID is properly identified and removed by the driver without accidently deleting any valid LDs. Fixes: ae6874b ("scsi: megaraid_sas: Early detection of VD deletion through RaidMap update") Reported-by: Martin K. Petersen <[email protected]> Signed-off-by: Chandrakanth Patil <[email protected]> Signed-off-by: Sumit Saxena <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 8e45183 commit bfa6591

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/scsi/megaraid/megaraid_sas.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,8 @@ struct megasas_ctrl_info {
15191519
#define MEGASAS_MAX_LD_IDS (MEGASAS_MAX_LD_CHANNELS * \
15201520
MEGASAS_MAX_DEV_PER_CHANNEL)
15211521

1522+
#define MEGASAS_MAX_SUPPORTED_LD_IDS 240
1523+
15221524
#define MEGASAS_MAX_SECTORS (2*1024)
15231525
#define MEGASAS_MAX_SECTORS_IEEE (2*128)
15241526
#define MEGASAS_DBG_LVL 1

drivers/scsi/megaraid/megaraid_sas_fp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance, u64 map_id)
358358
ld = MR_TargetIdToLdGet(i, drv_map);
359359

360360
/* For non existing VDs, iterate to next VD*/
361-
if (ld >= (MAX_LOGICAL_DRIVES_EXT - 1))
361+
if (ld >= MEGASAS_MAX_SUPPORTED_LD_IDS)
362362
continue;
363363

364364
raid = MR_LdRaidGet(ld, drv_map);

0 commit comments

Comments
 (0)