public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "nab@linux-iscsi.org" <nab@linux-iscsi.org>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"himanshu.madhani@cavium.com" <himanshu.madhani@cavium.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: [PATCH 20/25] qla2xxx: Remove redundant code
Date: Mon, 22 May 2017 18:23:04 +0000	[thread overview]
Message-ID: <1495477383.1017.3.camel@sandisk.com> (raw)
In-Reply-To: <1495427279.27407.20.camel@haakon3.risingtidesystems.com>

On Sun, 2017-05-21 at 21:27 -0700, Nicholas A. Bellinger wrote:
> The three lists abort_cmd_for_tag() walks from __qlt_24xx_handle_abts()
> are used to track descriptors only before __qlt_do_work() is reached,
> and before a descriptor is submitted into tcm_qla2xxx code.
> 
> Or rather, the three lists in abort_cmd_for_tag() only contain
> qla_tgt_cmd or qla_tgt_sess_op descriptors that have not yet reached
> qla_tgt_func_tmpl->handle_cmd() code.
> 
> Both qlt_do_work() and qlt_create_sess_from_atio() drop their respective
> descriptors from ->cmd_list before dispatching into tcm_qla2xxx ->
> target-core, which means there is no way for a descriptor to be part of
> internal lists once __qlt_do_work() is called.
> 
> That said, the patch is correct and removes the redundant lookup.

I do not agree that this patch is makes ABTS handling fully robust. It seems
like you have not noticed that the following race can occur with or without
this patch applied: if abort_cmd_for_tag() and qlt_try_to_dequeue_unknown_atios()
are called concurrently, since the latter function calls list_del() after
qlt_send_term_exchange(), abort_cmd_for_tag() can return 1 and thereby trigger
a call to qlt_24xx_send_abts_resp() while qlt_try_to_dequeue_unknown_atios()
calls qlt_send_term_exchange() concurrently. I think an initiator could get
really confused if it receives two responses for the same exchange.

An existing issue that is not addressed by this patch is that if an ABTS is
received after qlt_do_work() has called list_del() and before __qlt_do_work()
triggers a call target_submit_cmd() that a command is not on any list and hence
that abort_cmd_for_tag() won't be able to find it anywhere.

Shouldn't these issues be addressed properly?

Bart.

  reply	other threads:[~2017-05-22 18:23 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
2017-05-22  4:27     ` Nicholas A. Bellinger
2017-05-22 18:23       ` Bart Van Assche [this message]
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=1495477383.1017.3.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 \
    --cc=nab@linux-iscsi.org \
    /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