All of lore.kernel.org
 help / color / mirror / Atom feed
From: "jirong.feng" <jirong.feng@easystack.cn>
To: martin.petersen@oracle.com, michael.christie@oracle.com,
	mlombard@redhat.com, d.bogdanov@yadro.com
Cc: dongsheng.yang@easystack.cn, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
	"jirong.feng" <jirong.feng@easystack.cn>
Subject: [PATCH RFC] scsi: target: iscsi: Handle abort for ICF_OOO_CMDSN cmds
Date: Tue, 25 Jul 2023 11:33:35 +0000	[thread overview]
Message-ID: <20230725113335.194721-1-jirong.feng@easystack.cn> (raw)

If a connection closes with an ICF_OOO_CMDSN cmd being aborted, then
rx thread will wait for the abort cmd to complete. At the same time,
the abort kworker is waiting for the ooo cmd's completion. Since rx
thread is waiting too, that ooo cmd can never reach to completion, so
is the abort cmd, causing both rx thread and abort kworker hanging
indefinitely.

Add handling in TCM of the abort for the ICF_OOO_CMDSN cmds at
connection closing moment to make it possible to release them.
---
 drivers/target/iscsi/iscsi_target.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index b516c2893420..27edc5eb9e6e 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4236,7 +4236,8 @@ static void iscsit_release_commands_from_conn(struct iscsit_conn *conn)
 			se_cmd->transport_state |= CMD_T_FABRIC_STOP;
 		}
 
-		if (cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING) {
+		if (cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING ||
+		    cmd->cmd_flags & ICF_OOO_CMDSN) {
 			/*
 			 * We never submitted the cmd to LIO core, so we have
 			 * to tell LIO to perform the completion process.
-- 
2.25.1


                 reply	other threads:[~2023-07-25 11:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230725113335.194721-1-jirong.feng@easystack.cn \
    --to=jirong.feng@easystack.cn \
    --cc=d.bogdanov@yadro.com \
    --cc=dongsheng.yang@easystack.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=mlombard@redhat.com \
    --cc=target-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.