Skip to content

Commit eb3fe26

Browse files
shivasharan-smartinkpetersen
authored andcommitted
scsi: megaraid_sas: Return pended IOCTLs with cmd_status MFI_STAT_WRONG_STATE in case adapter is dead
After a kill adapter, since the cmd_status is not set, the IOCTLs will be hung in driver resulting in application hang. Set cmd_status MFI_STAT_WRONG_STATE when completing pended IOCTLs. Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: Shivasharan S <[email protected]> Cc: [email protected] Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Tomas Henzl <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent def3e8d commit eb3fe26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1996,9 +1996,12 @@ static void megasas_complete_outstanding_ioctls(struct megasas_instance *instanc
19961996
if (cmd_fusion->sync_cmd_idx != (u32)ULONG_MAX) {
19971997
cmd_mfi = instance->cmd_list[cmd_fusion->sync_cmd_idx];
19981998
if (cmd_mfi->sync_cmd &&
1999-
cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT)
1999+
(cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT)) {
2000+
cmd_mfi->frame->hdr.cmd_status =
2001+
MFI_STAT_WRONG_STATE;
20002002
megasas_complete_cmd(instance,
20012003
cmd_mfi, DID_OK);
2004+
}
20022005
}
20032006
}
20042007
} else {

0 commit comments

Comments
 (0)