Skip to content

Commit 3cd1c5d

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: "Six small fixes, five in drivers and one to correct another minor regression from cc97923 ("block: move dma drain handling to scsi") where we still need the drain stub to be built in to the kernel for the modular libata, non-modular SAS driver case" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: mptscsih: Fix read sense data size scsi: zfcp: Fix panic on ERP timeout for previously dismissed ERP action scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset() scsi: libata: Fix the ata_scsi_dma_need_drain stub scsi: qla2xxx: Keep initiator ports after RSCN scsi: qla2xxx: Set NVMe status code for failed NVMe FCP request
2 parents c322f53 + afe89f1 commit 3cd1c5d

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

drivers/message/fusion/mptscsih.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);
118118
int mptscsih_resume(struct pci_dev *pdev);
119119
#endif
120120

121-
#define SNS_LEN(scp) SCSI_SENSE_BUFFERSIZE
122-
123121

124122
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
125123
/*
@@ -2422,7 +2420,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
24222420
/* Copy the sense received into the scsi command block. */
24232421
req_index = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
24242422
sense_data = ((u8 *)ioc->sense_buf_pool + (req_index * MPT_SENSE_BUFFER_ALLOC));
2425-
memcpy(sc->sense_buffer, sense_data, SNS_LEN(sc));
2423+
memcpy(sc->sense_buffer, sense_data, MPT_SENSE_BUFFER_ALLOC);
24262424

24272425
/* Log SMART data (asc = 0x5D, non-IM case only) if required.
24282426
*/

drivers/s390/scsi/zfcp_erp.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,10 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act)
577577
ZFCP_STATUS_ERP_TIMEDOUT)) {
578578
req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
579579
zfcp_dbf_rec_run("erscf_1", act);
580-
req->erp_action = NULL;
580+
/* lock-free concurrent access with
581+
* zfcp_erp_timeout_handler()
582+
*/
583+
WRITE_ONCE(req->erp_action, NULL);
581584
}
582585
if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
583586
zfcp_dbf_rec_run("erscf_2", act);
@@ -613,8 +616,14 @@ void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask)
613616
void zfcp_erp_timeout_handler(struct timer_list *t)
614617
{
615618
struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer);
616-
struct zfcp_erp_action *act = fsf_req->erp_action;
619+
struct zfcp_erp_action *act;
617620

621+
if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED)
622+
return;
623+
/* lock-free concurrent access with zfcp_erp_strategy_check_fsfreq() */
624+
act = READ_ONCE(fsf_req->erp_action);
625+
if (!act)
626+
return;
618627
zfcp_erp_notify(act, ZFCP_STATUS_ERP_TIMEDOUT);
619628
}
620629

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11878,7 +11878,8 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba)
1187811878
lpfc_sli4_xri_exchange_busy_wait(phba);
1187911879

1188011880
/* per-phba callback de-registration for hotplug event */
11881-
lpfc_cpuhp_remove(phba);
11881+
if (phba->pport)
11882+
lpfc_cpuhp_remove(phba);
1188211883

1188311884
/* Disable PCI subsystem interrupt */
1188411885
lpfc_sli4_disable_intr(phba);

drivers/scsi/qla2xxx/qla_gs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3496,7 +3496,9 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
34963496
qla2x00_clear_loop_id(fcport);
34973497
fcport->flags |= FCF_FABRIC_DEVICE;
34983498
} else if (fcport->d_id.b24 != rp->id.b24 ||
3499-
fcport->scan_needed) {
3499+
(fcport->scan_needed &&
3500+
fcport->port_type != FCT_INITIATOR &&
3501+
fcport->port_type != FCT_NVME_INITIATOR)) {
35003502
qlt_schedule_sess_for_deletion(fcport);
35013503
}
35023504
fcport->d_id.b24 = rp->id.b24;

drivers/scsi/qla2xxx/qla_nvme.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,12 @@ static void qla_nvme_release_fcp_cmd_kref(struct kref *kref)
139139
sp->priv = NULL;
140140
if (priv->comp_status == QLA_SUCCESS) {
141141
fd->rcv_rsplen = le16_to_cpu(nvme->u.nvme.rsp_pyld_len);
142+
fd->status = NVME_SC_SUCCESS;
142143
} else {
143144
fd->rcv_rsplen = 0;
144145
fd->transferred_length = 0;
146+
fd->status = NVME_SC_INTERNAL;
145147
}
146-
fd->status = 0;
147148
spin_unlock_irqrestore(&priv->cmd_lock, flags);
148149

149150
fd->done(fd);

include/linux/libata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ extern int ata_scsi_ioctl(struct scsi_device *dev, unsigned int cmd,
10951095
#define ATA_SCSI_COMPAT_IOCTL /* empty */
10961096
#endif
10971097
extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd);
1098-
#if IS_ENABLED(CONFIG_ATA)
1098+
#if IS_REACHABLE(CONFIG_ATA)
10991099
bool ata_scsi_dma_need_drain(struct request *rq);
11001100
#else
11011101
#define ata_scsi_dma_need_drain NULL

0 commit comments

Comments
 (0)