Skip to content

Commit 8a57646

Browse files
committed
Merge remote-tracking branch 'mkp-scsi/4.9/scsi-fixes' into fixes
2 parents 49ce5b5 + 5e5ec17 commit 8a57646

7 files changed

Lines changed: 29 additions & 8 deletions

File tree

drivers/scsi/cxgbi/libcxgbi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2081,9 +2081,10 @@ void cxgbi_cleanup_task(struct iscsi_task *task)
20812081
/* never reached the xmit task callout */
20822082
if (tdata->skb)
20832083
__kfree_skb(tdata->skb);
2084-
memset(tdata, 0, sizeof(*tdata));
20852084

20862085
task_release_itt(task, task->hdr_itt);
2086+
memset(tdata, 0, sizeof(*tdata));
2087+
20872088
iscsi_tcp_cleanup_task(task);
20882089
}
20892090
EXPORT_SYMBOL_GPL(cxgbi_cleanup_task);

drivers/scsi/device_handler/scsi_dh_alua.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ static void alua_rtpg_work(struct work_struct *work)
793793
WARN_ON(pg->flags & ALUA_PG_RUN_RTPG);
794794
WARN_ON(pg->flags & ALUA_PG_RUN_STPG);
795795
spin_unlock_irqrestore(&pg->lock, flags);
796+
kref_put(&pg->kref, release_port_group);
796797
return;
797798
}
798799
if (pg->flags & ALUA_SYNC_STPG)
@@ -890,6 +891,7 @@ static void alua_rtpg_queue(struct alua_port_group *pg,
890891
/* Do not queue if the worker is already running */
891892
if (!(pg->flags & ALUA_PG_RUNNING)) {
892893
kref_get(&pg->kref);
894+
sdev = NULL;
893895
start_queue = 1;
894896
}
895897
}
@@ -901,7 +903,8 @@ static void alua_rtpg_queue(struct alua_port_group *pg,
901903
if (start_queue &&
902904
!queue_delayed_work(alua_wq, &pg->rtpg_work,
903905
msecs_to_jiffies(ALUA_RTPG_DELAY_MSECS))) {
904-
scsi_device_put(sdev);
906+
if (sdev)
907+
scsi_device_put(sdev);
905908
kref_put(&pg->kref, release_port_group);
906909
}
907910
}

drivers/scsi/megaraid/megaraid_sas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ struct megasas_instance_template {
22332233
};
22342234

22352235
#define MEGASAS_IS_LOGICAL(scp) \
2236-
(scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1
2236+
((scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1)
22372237

22382238
#define MEGASAS_DEV_INDEX(scp) \
22392239
(((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + \

drivers/scsi/mpt3sas/mpt3sas_scsih.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,9 +1273,9 @@ scsih_target_alloc(struct scsi_target *starget)
12731273
sas_target_priv_data->handle = raid_device->handle;
12741274
sas_target_priv_data->sas_address = raid_device->wwid;
12751275
sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME;
1276-
sas_target_priv_data->raid_device = raid_device;
12771276
if (ioc->is_warpdrive)
1278-
raid_device->starget = starget;
1277+
sas_target_priv_data->raid_device = raid_device;
1278+
raid_device->starget = starget;
12791279
}
12801280
spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
12811281
return 0;

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,11 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
707707
srb_t *sp;
708708
int rval;
709709

710+
if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags))) {
711+
cmd->result = DID_NO_CONNECT << 16;
712+
goto qc24_fail_command;
713+
}
714+
710715
if (ha->flags.eeh_busy) {
711716
if (ha->flags.pci_channel_io_perm_failure) {
712717
ql_dbg(ql_dbg_aer, vha, 0x9010,
@@ -1451,6 +1456,15 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
14511456
for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) {
14521457
sp = req->outstanding_cmds[cnt];
14531458
if (sp) {
1459+
/* Get a reference to the sp and drop the lock.
1460+
* The reference ensures this sp->done() call
1461+
* - and not the call in qla2xxx_eh_abort() -
1462+
* ends the SCSI command (with result 'res').
1463+
*/
1464+
sp_get(sp);
1465+
spin_unlock_irqrestore(&ha->hardware_lock, flags);
1466+
qla2xxx_eh_abort(GET_CMD_SP(sp));
1467+
spin_lock_irqsave(&ha->hardware_lock, flags);
14541468
req->outstanding_cmds[cnt] = NULL;
14551469
sp->done(vha, sp, res);
14561470
}
@@ -2341,6 +2355,8 @@ qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time)
23412355
{
23422356
scsi_qla_host_t *vha = shost_priv(shost);
23432357

2358+
if (test_bit(UNLOADING, &vha->dpc_flags))
2359+
return 1;
23442360
if (!vha->host)
23452361
return 1;
23462362
if (time > vha->hw->loop_reset_delay * HZ)

drivers/scsi/vmw_pvscsi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ static int pvscsi_abort(struct scsi_cmnd *cmd)
793793
unsigned long flags;
794794
int result = SUCCESS;
795795
DECLARE_COMPLETION_ONSTACK(abort_cmp);
796+
int done;
796797

797798
scmd_printk(KERN_DEBUG, cmd, "task abort on host %u, %p\n",
798799
adapter->host->host_no, cmd);
@@ -824,10 +825,10 @@ static int pvscsi_abort(struct scsi_cmnd *cmd)
824825
pvscsi_abort_cmd(adapter, ctx);
825826
spin_unlock_irqrestore(&adapter->hw_lock, flags);
826827
/* Wait for 2 secs for the completion. */
827-
wait_for_completion_timeout(&abort_cmp, msecs_to_jiffies(2000));
828+
done = wait_for_completion_timeout(&abort_cmp, msecs_to_jiffies(2000));
828829
spin_lock_irqsave(&adapter->hw_lock, flags);
829830

830-
if (!completion_done(&abort_cmp)) {
831+
if (!done) {
831832
/*
832833
* Failed to abort the command, unmark the fact that it
833834
* was requested to be aborted.

drivers/scsi/vmw_pvscsi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include <linux/types.h>
2828

29-
#define PVSCSI_DRIVER_VERSION_STRING "1.0.6.0-k"
29+
#define PVSCSI_DRIVER_VERSION_STRING "1.0.7.0-k"
3030

3131
#define PVSCSI_MAX_NUM_SG_ENTRIES_PER_SEGMENT 128
3232

0 commit comments

Comments
 (0)