From: Mike Christie <michael.christie@oracle.com>
To: Maurizio Lombardi <mlombard@redhat.com>, martin.petersen@oracle.com
Cc: serapheim.dimitro@delphix.com, target-devel@vger.kernel.org
Subject: Re: [PATCH 1/3] target: iscsi: fix hang in the iSCSI login code
Date: Fri, 10 Mar 2023 13:53:12 -0600 [thread overview]
Message-ID: <cf7d047d-bd71-6793-802f-c1c38a7a2afa@oracle.com> (raw)
In-Reply-To: <20230310100423.1258256-2-mlombard@redhat.com>
On 3/10/23 4:04 AM, Maurizio Lombardi wrote:
> If the initiator suddenly stops sending data during a login while
> keeping the TCP connection open, the sk_data_ready callback won't
> schedule the login_work and the latter
> will never timeout and release the login semaphore.
>
> All the other login operations will therefore get stuck waiting
> for the semaphore to be released.
>
You mean np_login_sem right? Do you know why we have to serialize access
to the np during login? Is it just a simple way to handle the internal
target variables for things like MC/s, reinstatement, etc? I saw the tsih
case, but am wondering how easy it is to remove.
If we need the sem why do we use the sk_callback/non-blocking type of
approach when we can only do 1 login at a time per tpg? We end up
creating 2 threads per connection after FFP, so it seems like we would
have enough resources for a temp login thread before FFP. Looking over
the commit history, we seem to hit a good number of bugs in this code.
It seems like we could simplify the login code by do a blocking type of
implementation where:
1. __iscsi_target_login_thread starts a workstruct that runs
iscsi_target_start_negotiation. It would then run iscsi_target_do_login_rx
which just waits for a response. When we get one, it does iscsi_target_do_login
and if we need more PDUs loops. We have one timer for all this.
2. We can remove the np_login_sem. It would be replaced by a workstruct
in the np. __iscsi_target_login_thread would just flush the work to make sure
we are not running a login on the same np already.
3. We can remove all the sk_callback* related code for iscsit tcp since
recvmsg just return failure when the state changes.
4. It looks like cxgbit will work with some small changes because I think it
just kicks off iscsi_target_do_login_rx after sending a login PDU, then it
just waits in its iscsit_get_login_rx.
5. It looks like isert will also work, because it's isert_get_login_rx can
just wait on the login_req_comp/login_comp already.
next prev parent reply other threads:[~2023-03-10 19:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 10:04 [PATCH 0/3] Fix possible hangs and race conditions during login Maurizio Lombardi
2023-03-10 10:04 ` [PATCH 1/3] target: iscsi: fix hang in the iSCSI login code Maurizio Lombardi
2023-03-10 19:53 ` Mike Christie [this message]
2023-03-13 9:06 ` Maurizio Lombardi
2023-03-13 23:52 ` Mike Christie
2023-03-14 11:09 ` Maurizio Lombardi
2023-03-14 21:23 ` Mike Christie
2023-03-21 17:13 ` Maurizio Lombardi
2023-03-10 10:04 ` [PATCH 2/3] target: iscsi: remove unused transport_timer Maurizio Lombardi
2023-03-10 10:04 ` [PATCH 3/3] target: iscsi: prevent login threads from racing between each other Maurizio Lombardi
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=cf7d047d-bd71-6793-802f-c1c38a7a2afa@oracle.com \
--to=michael.christie@oracle.com \
--cc=martin.petersen@oracle.com \
--cc=mlombard@redhat.com \
--cc=serapheim.dimitro@delphix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).