Re: [PATCH v2 2/8] qla2xxx: cleanup cmd in qla workqueue before processing TMR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/14/2015 10:00 PM, Himanshu Madhani wrote:
> From: Swapnil Nagle <swapnil.nagle@xxxxxxxxxxxxxxx>
> 
> Since cmds go into qla_tgt_wq and TMRs don't, it's possible that TMR
> like TASK_ABORT can be queued over the cmd for which it was meant.
> To avoid this race, use a per-port list to keep track of cmds that
> are enqueued to qla_tgt_wq but not yet processed. When a TMR arrives,
> iterate through this list and remove any cmds that match the TMR.
> This patch supports TASK_ABORT and LUN_RESET.
> 
> Cc: <stable@xxxxxxxxxxxxxxx>
> Signed-off-by: Swapnil Nagle <swapnil.nagle@xxxxxxxxxxxxxxx>
> Signed-off-by: Alexei Potashnik <alexei@xxxxxxxxxxxxxxx>
> Acked-by: Quinn Tran <quinn.tran@xxxxxxxxxx>
> Signed-off-by: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx>
> ---
[ .. ]
> @@ -3374,14 +3462,25 @@ static void qlt_create_sess_from_atio(struct work_struct *work)
>  	unsigned long flags;
>  	uint8_t *s_id = op->atio.u.isp24.fcp_hdr.s_id;
>  
> +	spin_lock_irqsave(&vha->cmd_list_lock, flags);
> +	list_del(&op->cmd_list);
> +	spin_unlock_irqrestore(&vha->cmd_list_lock, flags);
> +
> +	if (op->aborted) {
> +		ql_dbg(ql_dbg_tgt_mgt, vha, 0xf083,
> +		    "sess_op with tag %u is aborted\n",
> +		    op->atio.u.isp24.exchange_addr);
> +		goto out_term;
> +	}
> +
>  	ql_dbg(ql_dbg_tgt_mgt, vha, 0xf022,
> -		"qla_target(%d): Unable to find wwn login"
> -		" (s_id %x:%x:%x), trying to create it manually\n",
> -		vha->vp_idx, s_id[0], s_id[1], s_id[2]);
> +	    "qla_target(%d): Unable to find wwn login"
> +	    " (s_id %x:%x:%x), trying to create it manually\n",
> +	    vha->vp_idx, s_id[0], s_id[1], s_id[2]);
>  
>  	if (op->atio.u.raw.entry_count > 1) {
>  		ql_dbg(ql_dbg_tgt_mgt, vha, 0xf023,
> -		        "Dropping multy entry atio %p\n", &op->atio);
> +		    "Dropping multy entry atio %p\n", &op->atio);
>  		goto out_term;
>  	}
>  
Pointless indentation change.

Other than that:
Reviewed-by: Hannes Reinecke <hare@xxxxxxxx>

Cheers,

Hannes

-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@xxxxxxx			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux