diff options
-rw-r--r-- | drivers/scsi/libfc/fc_rport.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libiscsi.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 3 | ||||
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 10 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_fc.c | 3 |
5 files changed, 15 insertions, 5 deletions
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index 520325867e2b..31d31aad3de1 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c | |||
@@ -383,11 +383,11 @@ static void fc_rport_work(struct work_struct *work) | |||
383 | fc_rport_enter_flogi(rdata); | 383 | fc_rport_enter_flogi(rdata); |
384 | mutex_unlock(&rdata->rp_mutex); | 384 | mutex_unlock(&rdata->rp_mutex); |
385 | } else { | 385 | } else { |
386 | mutex_unlock(&rdata->rp_mutex); | ||
386 | FC_RPORT_DBG(rdata, "work delete\n"); | 387 | FC_RPORT_DBG(rdata, "work delete\n"); |
387 | mutex_lock(&lport->disc.disc_mutex); | 388 | mutex_lock(&lport->disc.disc_mutex); |
388 | list_del_rcu(&rdata->peers); | 389 | list_del_rcu(&rdata->peers); |
389 | mutex_unlock(&lport->disc.disc_mutex); | 390 | mutex_unlock(&lport->disc.disc_mutex); |
390 | mutex_unlock(&rdata->rp_mutex); | ||
391 | kref_put(&rdata->kref, fc_rport_destroy); | 391 | kref_put(&rdata->kref, fc_rport_destroy); |
392 | } | 392 | } |
393 | } else { | 393 | } else { |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index c62e8d111fd9..f8dc1601efd5 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -1728,7 +1728,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) | |||
1728 | 1728 | ||
1729 | if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) { | 1729 | if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) { |
1730 | reason = FAILURE_SESSION_IN_RECOVERY; | 1730 | reason = FAILURE_SESSION_IN_RECOVERY; |
1731 | sc->result = DID_REQUEUE; | 1731 | sc->result = DID_REQUEUE << 16; |
1732 | goto fault; | 1732 | goto fault; |
1733 | } | 1733 | } |
1734 | 1734 | ||
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 5b2437a5ea44..937209805baf 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -3175,6 +3175,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
3175 | host->can_queue, base_vha->req, | 3175 | host->can_queue, base_vha->req, |
3176 | base_vha->mgmt_svr_loop_id, host->sg_tablesize); | 3176 | base_vha->mgmt_svr_loop_id, host->sg_tablesize); |
3177 | 3177 | ||
3178 | INIT_WORK(&base_vha->iocb_work, qla2x00_iocb_work_fn); | ||
3179 | |||
3178 | if (ha->mqenable) { | 3180 | if (ha->mqenable) { |
3179 | bool mq = false; | 3181 | bool mq = false; |
3180 | bool startit = false; | 3182 | bool startit = false; |
@@ -3223,7 +3225,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
3223 | */ | 3225 | */ |
3224 | qla2xxx_wake_dpc(base_vha); | 3226 | qla2xxx_wake_dpc(base_vha); |
3225 | 3227 | ||
3226 | INIT_WORK(&base_vha->iocb_work, qla2x00_iocb_work_fn); | ||
3227 | INIT_WORK(&ha->board_disable, qla2x00_disable_board_on_pci_error); | 3228 | INIT_WORK(&ha->board_disable, qla2x00_disable_board_on_pci_error); |
3228 | 3229 | ||
3229 | if (IS_QLA8031(ha) || IS_MCTP_CAPABLE(ha)) { | 3230 | if (IS_QLA8031(ha) || IS_MCTP_CAPABLE(ha)) { |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index bf53356f41f0..f796bd61f3f0 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -1376,13 +1376,19 @@ static void __scsi_remove_target(struct scsi_target *starget) | |||
1376 | spin_lock_irqsave(shost->host_lock, flags); | 1376 | spin_lock_irqsave(shost->host_lock, flags); |
1377 | restart: | 1377 | restart: |
1378 | list_for_each_entry(sdev, &shost->__devices, siblings) { | 1378 | list_for_each_entry(sdev, &shost->__devices, siblings) { |
1379 | /* | ||
1380 | * We cannot call scsi_device_get() here, as | ||
1381 | * we might've been called from rmmod() causing | ||
1382 | * scsi_device_get() to fail the module_is_live() | ||
1383 | * check. | ||
1384 | */ | ||
1379 | if (sdev->channel != starget->channel || | 1385 | if (sdev->channel != starget->channel || |
1380 | sdev->id != starget->id || | 1386 | sdev->id != starget->id || |
1381 | scsi_device_get(sdev)) | 1387 | !get_device(&sdev->sdev_gendev)) |
1382 | continue; | 1388 | continue; |
1383 | spin_unlock_irqrestore(shost->host_lock, flags); | 1389 | spin_unlock_irqrestore(shost->host_lock, flags); |
1384 | scsi_remove_device(sdev); | 1390 | scsi_remove_device(sdev); |
1385 | scsi_device_put(sdev); | 1391 | put_device(&sdev->sdev_gendev); |
1386 | spin_lock_irqsave(shost->host_lock, flags); | 1392 | spin_lock_irqsave(shost->host_lock, flags); |
1387 | goto restart; | 1393 | goto restart; |
1388 | } | 1394 | } |
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index cbd4495d0ff9..8c46a6d536af 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -3320,6 +3320,9 @@ int fc_block_scsi_eh(struct scsi_cmnd *cmnd) | |||
3320 | { | 3320 | { |
3321 | struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device)); | 3321 | struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device)); |
3322 | 3322 | ||
3323 | if (WARN_ON_ONCE(!rport)) | ||
3324 | return FAST_IO_FAIL; | ||
3325 | |||
3323 | return fc_block_rport(rport); | 3326 | return fc_block_rport(rport); |
3324 | } | 3327 | } |
3325 | EXPORT_SYMBOL(fc_block_scsi_eh); | 3328 | EXPORT_SYMBOL(fc_block_scsi_eh); |