SCSI fixes for 4.14-rc5
James Bottomley
maintainerFour mostly error leg fixes and one more important regression in a prior commit (the qla2xxx one).
The patch is available here:
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes
The short changelog is:
Hannes Reinecke (1):
scsi: fixup kernel warning during rmmod()
Johannes Thumshirn (2):
scsi: fc: check for rport presence in fc_block_scsi_eh
scsi: libiscsi: fix shifting of DID_REQUEUE host byte
Quinn Tran (1):
scsi: qla2xxx: Fix uninitialized work element
Satish Kharat (1):
scsi: libfc: fix a deadlock in fc_rport_work
And the diffstat:
drivers/scsi/libfc/fc_rport.c | 2 +- drivers/scsi/libiscsi.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 3 ++- drivers/scsi/scsi_sysfs.c | 10 ++++++++-- drivers/scsi/scsi_transport_fc.c | 3 +++ 5 files changed, 15 insertions(+), 5 deletions(-)
With full diff below.
James
---
drivers/scsi/libfc/fc_rport.c +1 -1
@@ -383,11 +383,11 @@ static void fc_rport_work(struct work_struct *work)fc_rport_enter_flogi (rdata);mutex_unlock (&rdata->rp_mutex); }else { +mutex_unlock (&rdata->rp_mutex);FC_RPORT_DBG (rdata,"work delete\n" );mutex_lock (&lport->disc.disc_mutex);list_del_rcu (&rdata->peers);mutex_unlock (&lport->disc.disc_mutex); -mutex_unlock (&rdata->rp_mutex);kref_put (&rdata->kref, fc_rport_destroy); } }else {
drivers/scsi/libiscsi.c +1 -1
@@ -1728,7 +1728,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc)if (test_bit (ISCSI_SUSPEND_BIT , &conn->suspend_tx)) { reason =FAILURE_SESSION_IN_RECOVERY ; - sc->result =DID_REQUEUE ; + sc->result =DID_REQUEUE <<16 ; goto fault; }
drivers/scsi/qla2xxx/qla_os.c +2 -1
@@ -3175,6 +3175,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) host->can_queue, base_vha->req, base_vha->mgmt_svr_loop_id, host->sg_tablesize); +INIT_WORK (&base_vha->iocb_work, qla2x00_iocb_work_fn); +if (ha->mqenable) {bool mq = false;bool startit = false;
@@ -3223,7 +3225,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)*/ qla2xxx_wake_dpc (base_vha); -INIT_WORK (&base_vha->iocb_work, qla2x00_iocb_work_fn);INIT_WORK (&ha->board_disable, qla2x00_disable_board_on_pci_error);if (IS_QLA8031 (ha) ||IS_MCTP_CAPABLE (ha)) {
drivers/scsi/scsi_sysfs.c +8 -2
@@ -1376,13 +1376,19 @@ static void __scsi_remove_target(struct scsi_target *starget)spin_lock_irqsave (shost->host_lock, flags); restart:list_for_each_entry (sdev, &shost->__devices, siblings) { +/* +* We cannot call scsi_device_get() here, as +* we might've been called from rmmod() causing +* scsi_device_get() to fail the module_is_live() +* check. +*/ if (sdev->channel != starget->channel || sdev->id != starget->id || -scsi_device_get (sdev)) + !get_device (&sdev->sdev_gendev))continue ;spin_unlock_irqrestore (shost->host_lock, flags);scsi_remove_device (sdev); -scsi_device_put (sdev); +put_device (&sdev->sdev_gendev);spin_lock_irqsave (shost->host_lock, flags); goto restart; }
drivers/scsi/scsi_transport_fc.c +3 -0
@@ -3320,6 +3320,9 @@ int fc_block_scsi_eh(struct scsi_cmnd *cmnd) {struct fc_rport *rport =starget_to_rport (scsi_target (cmnd->device)); +if (WARN_ON_ONCE (!rport)) +return FAST_IO_FAIL ; +return fc_block_rport (rport); }EXPORT_SYMBOL (fc_block_scsi_eh);