public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"himanshu.madhani@cavium.com" <himanshu.madhani@cavium.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH 20/25] qla2xxx: Remove redundant code
Date: Fri, 19 May 2017 23:43:00 +0000	[thread overview]
Message-ID: <1495237379.2581.19.camel@sandisk.com> (raw)
In-Reply-To: <20170519215344.2168-21-himanshu.madhani@cavium.com>

On Fri, 2017-05-19 at 14:53 -0700, Himanshu Madhani wrote:
> From: Quinn Tran <quinn.tran@cavium.com>
> 
> During ABTS or Abort task, qla2xxx does a pre-search for
> the se_cmd, based on command's tag. The same search is
> performed by TCM. Remove the extra search from qla2xxx.
> 
> Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
> ---
>  drivers/scsi/qla2xxx/qla_target.c | 29 ++++-------------------------
>  1 file changed, 4 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index 21e8993baf4b..b8e609ae6cff 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -1836,34 +1836,13 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha,
>  	struct abts_recv_from_24xx *abts, struct fc_port *sess)
>  {
>  	struct qla_hw_data *ha = vha->hw;
> -	struct se_session *se_sess = sess->se_sess;
>  	struct qla_tgt_mgmt_cmd *mcmd;
> -	struct se_cmd *se_cmd;
>  	int rc;
> -	bool found_lun = false;
> -	unsigned long flags;
> -
> -	spin_lock_irqsave(&se_sess->sess_cmd_lock, flags);
> -	list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) {
> -		if (se_cmd->tag == abts->exchange_addr_to_abort) {
> -			found_lun = true;
> -			break;
> -		}
> -	}
> -	spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags);
>  
> -	/* cmd not in LIO lists, look in qla list */
> -	if (!found_lun) {
> -		if (abort_cmd_for_tag(vha, abts->exchange_addr_to_abort)) {
> -			/* send TASK_ABORT response immediately */
> -			qlt_24xx_send_abts_resp(vha, abts, FCP_TMF_CMPL, false);
> -			return 0;
> -		} else {
> -			ql_dbg(ql_dbg_tgt_mgt, vha, 0xf081,
> -			    "unable to find cmd in driver or LIO for tag 0x%x\n",
> -			    abts->exchange_addr_to_abort);
> -			return -ENOENT;
> -		}
> +	if (abort_cmd_for_tag(vha, abts->exchange_addr_to_abort)) {
> +		/* send TASK_ABORT response immediately */
> +		qlt_24xx_send_abts_resp(vha, abts, FCP_TMF_CMPL, false);
> +		return 0;
>  	}
>  
>  	ql_dbg(ql_dbg_tgt_mgt, vha, 0xf00f,

Hello Himanshu and Quinn,

Please drop this patch. If a command has already been submitted to the LIO
core and an ABTS is received then the LIO core should be requested to perform
the abort. This patch changes the behavior of the qla2xxx target driver such
that the LIO core is not informed at all if abort_cmd_for_tag() finds the
command that has to be aborted in one of the command lists maintained by the
qla2xxx driver. That can lead to the presence of overlapping writes in the
command set on the target system and hence to data corruption. Please note
that I had proposed a better approach on the target-devel mailing list and
that I'm still waiting for someone from Cavium to review these patches:
* [PATCH v6 09/33] target: Make it possible to specify I_T nexus for SCSI
  abort (http://www.spinics.net/lists/target-devel/msg14534.html).
* [PATCH v6 10/33] tcm_qla2xxx: Let the target core look up the LUN of the
  aborted cmd (http://www.spinics.net/lists/target-devel/msg14563.html).

Bart.

  reply	other threads:[~2017-05-19 23:43 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 21:53 [PATCH 00/25] qla2xxx: Bug fixes and cleanups Himanshu Madhani
2017-05-19 21:53 ` [PATCH 01/25] qla2xxx: Fix Target mode configuration for ISP25XX Himanshu Madhani
2017-05-19 21:53 ` [PATCH 02/25] qla2xxx: Remove redundant fc_host_port_name call Himanshu Madhani
2017-05-19 22:37   ` Bart Van Assche
2017-05-22 17:18     ` Madhani, Himanshu
2017-05-19 21:53 ` [PATCH 03/25] qla2xxx: Allow ABTS RX, RIDA on ATIOQ for ISP83XX/27XX Himanshu Madhani
2017-05-19 22:42   ` Bart Van Assche
2017-05-22 17:35     ` Madhani, Himanshu
2017-05-19 21:53 ` [PATCH 04/25] qla2xxx: Replace usage of spin_lock with spin_lock_irqsave Himanshu Madhani
2017-05-19 22:50   ` Bart Van Assche
2017-05-19 21:53 ` [PATCH 05/25] qla2xxx: Fix number of queue pairs creation for MQ Himanshu Madhani
2017-05-19 21:53 ` [PATCH 06/25] qla2xxx: Reduce excessive debug print during 27xx fwdump Himanshu Madhani
2017-05-21 10:43   ` kbuild test robot
2017-05-21 21:28   ` kbuild test robot
2017-05-19 21:53 ` [PATCH 07/25] qla2xxx: Allow fwdump template T262 to specify same start/end Himanshu Madhani
2017-05-19 21:53 ` [PATCH 08/25] qla2xxx: Set bit 15 for DIAG_ECHO_TEST MBC Himanshu Madhani
2017-05-19 21:53 ` [PATCH 09/25] qla2xxx: Fix mailbox pointer error in classic fwdump Himanshu Madhani
2017-05-19 21:53 ` [PATCH 10/25] qla2xxx: Prevent null pointer dereference of ctx Himanshu Madhani
2017-05-19 21:53 ` [PATCH 11/25] qla2xxx: Include Exchange offload/Extended Login into FW dump Himanshu Madhani
2017-05-19 21:53 ` [PATCH 12/25] qla2xxx: Fix path recovery Himanshu Madhani
2017-05-19 21:53 ` [PATCH 13/25] tcm_qla2xxx: Do not allow aborted cmd to advance Himanshu Madhani
2017-05-22  4:45   ` Nicholas A. Bellinger
2017-05-19 21:53 ` [PATCH 14/25] qla2xxx: Use flag PFLG_DISCONNECTED Himanshu Madhani
2017-05-19 21:53 ` [PATCH 15/25] qla2xxx: Convert 32-bit LUN usage to 64-bit Himanshu Madhani
2017-05-19 23:19   ` Bart Van Assche
2017-05-22  4:29   ` Nicholas A. Bellinger
2017-05-19 21:53 ` [PATCH 16/25] qla2xxx: Fix name server relogin Himanshu Madhani
2017-05-19 21:53 ` [PATCH 17/25] qla2xxx: Cleanup debug messager IDs Himanshu Madhani
2017-05-19 23:23   ` Bart Van Assche
2017-05-22 17:36     ` Madhani, Himanshu
2017-05-19 21:53 ` [PATCH 18/25] qla2xxx: Turn on FW option for exchange check Himanshu Madhani
2017-05-19 21:53 ` [PATCH 19/25] qla2xxx: Replace ql2xexchoffld & ql_dm_tgt_ex_pct parameter Himanshu Madhani
2017-05-19 23:27   ` Bart Van Assche
2017-05-22 17:39     ` Madhani, Himanshu
2017-05-19 21:53 ` [PATCH 20/25] qla2xxx: Remove redundant code Himanshu Madhani
2017-05-19 23:43   ` Bart Van Assche [this message]
2017-05-22  4:27     ` Nicholas A. Bellinger
2017-05-22 18:23       ` Bart Van Assche
2017-05-22 22:14         ` Tran, Quinn
2017-05-31 23:41           ` Bart Van Assche
2017-05-31 23:44             ` Tran, Quinn
2017-05-19 21:53 ` [PATCH 21/25] qla2xxx: Remove redundant wait when target is stopped Himanshu Madhani
2017-05-19 21:53 ` [PATCH 22/25] qla2xxx: Enable auto SCSI BUSY status for target mode Himanshu Madhani
2017-05-19 21:53 ` [PATCH 23/25] qla2xxx: Remove unused irq_cmd_count field Himanshu Madhani
2017-05-19 21:53 ` [PATCH 24/25] qla2xxx: Remove extra register read Himanshu Madhani
2017-05-19 21:53 ` [PATCH 25/25] qla2xxx: Simplify debug printing of portid Himanshu Madhani
2017-05-24  2:28 ` [PATCH 00/25] qla2xxx: Bug fixes and cleanups Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495237379.2581.19.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=himanshu.madhani@cavium.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox