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

Changed files
+6 -17
drivers
-9
drivers/scsi/arcmsr/arcmsr_hba.c
··· 2636 2636 struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; 2637 2637 struct CommandControlBlock *ccb; 2638 2638 int target = cmd->device->id; 2639 - int lun = cmd->device->lun; 2640 - uint8_t scsicmd = cmd->cmnd[0]; 2641 2639 cmd->scsi_done = done; 2642 2640 cmd->host_scribble = NULL; 2643 2641 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 - } 2651 2642 if (target == 16) { 2652 2643 /* virtual device for iop message transfer */ 2653 2644 arcmsr_handle_virtual_command(acb, cmd);
+5 -8
drivers/scsi/megaraid/megaraid_sas_base.c
··· 1700 1700 goto out_done; 1701 1701 } 1702 1702 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)) { 1709 1708 scmd->result = DID_OK << 16; 1710 1709 goto out_done; 1711 - default: 1712 - break; 1713 1710 } 1714 1711 1715 1712 return instance->instancet->build_and_issue_cmd(instance, scmd);
+1
drivers/scsi/scsi_debug.c
··· 5134 5134 bus_unregister(&pseudo_lld_bus); 5135 5135 root_device_unregister(pseudo_primary); 5136 5136 5137 + vfree(map_storep); 5137 5138 vfree(dif_storep); 5138 5139 vfree(fake_storep); 5139 5140 kfree(sdebug_q_arr);