Skip to content

Commit e12d8d5

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two more important data integrity fixes related to RAID device drivers which wrongly throw away the SYNCHRONIZE CACHE command in the non-RAID path and a memory leak in the scsi_debug driver" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: arcmsr: Send SYNCHRONIZE_CACHE command to firmware scsi: scsi_debug: Fix memory leak if LBP enabled and module is unloaded scsi: megaraid_sas: Fix data integrity failure for JBOD (passthrough) devices
2 parents f29b909 + 49ce5b5 commit e12d8d5

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

drivers/scsi/arcmsr/arcmsr_hba.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,18 +2636,9 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd,
26362636
struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata;
26372637
struct CommandControlBlock *ccb;
26382638
int target = cmd->device->id;
2639-
int lun = cmd->device->lun;
2640-
uint8_t scsicmd = cmd->cmnd[0];
26412639
cmd->scsi_done = done;
26422640
cmd->host_scribble = NULL;
26432641
cmd->result = 0;
2644-
if ((scsicmd == SYNCHRONIZE_CACHE) ||(scsicmd == SEND_DIAGNOSTIC)){
2645-
if(acb->devstate[target][lun] == ARECA_RAID_GONE) {
2646-
cmd->result = (DID_NO_CONNECT << 16);
2647-
}
2648-
cmd->scsi_done(cmd);
2649-
return 0;
2650-
}
26512642
if (target == 16) {
26522643
/* virtual device for iop message transfer */
26532644
arcmsr_handle_virtual_command(acb, cmd);

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,16 +1700,13 @@ megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
17001700
goto out_done;
17011701
}
17021702

1703-
switch (scmd->cmnd[0]) {
1704-
case SYNCHRONIZE_CACHE:
1705-
/*
1706-
* FW takes care of flush cache on its own
1707-
* No need to send it down
1708-
*/
1703+
/*
1704+
* FW takes care of flush cache on its own for Virtual Disk.
1705+
* No need to send it down for VD. For JBOD send SYNCHRONIZE_CACHE to FW.
1706+
*/
1707+
if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && MEGASAS_IS_LOGICAL(scmd)) {
17091708
scmd->result = DID_OK << 16;
17101709
goto out_done;
1711-
default:
1712-
break;
17131710
}
17141711

17151712
return instance->instancet->build_and_issue_cmd(instance, scmd);

drivers/scsi/scsi_debug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5134,6 +5134,7 @@ static void __exit scsi_debug_exit(void)
51345134
bus_unregister(&pseudo_lld_bus);
51355135
root_device_unregister(pseudo_primary);
51365136

5137+
vfree(map_storep);
51375138
vfree(dif_storep);
51385139
vfree(fake_storep);
51395140
kfree(sdebug_q_arr);

0 commit comments

Comments
 (0)