All of lore.kernel.org
 help / color / mirror / Atom feed
From: <lduncan@suse.com>
To: linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, open-iscsi@googlegroups.com,
	martin.petersen@oracle.com, mchristi@redhat.com, hare@suse.com,
	Lee Duncan <lduncan@suse.com>
Subject: [PATCH v2 0/1] scsi: libiscsi: fix NOP race condition
Date: Fri, 25 Sep 2020 11:41:47 -0700	[thread overview]
Message-ID: <cover.1601058301.git.lduncan@suse.com> (raw)

From: Lee Duncan <lduncan@suse.com>

A customer that uses iSCSI NOPs extensively found a race
condition caused in part by the two-lock system used in
iscsi (a forward and a back lock), since sending an iSCSI
NOP uses the forward lock, and receiving one uses the
back lock. Because of this, processing of the "send"
can still be in progress when the "receive" occurs, on
a sufficiently fast multicore system.

To handle this case, we add a new state to the "ping_task"
pointer besides unassigned and assigned, called "invalid",
which means the "not yet completed sending". Tests show
this closes this race condition hole.

Changes since V1:
- Removed two redundant lines in iscsi_send_nopout()
- Updated commit text to be more clear
- Added this cover letter with even more info

Lee Duncan (1):
  scsi: libiscsi: fix NOP race condition

 drivers/scsi/libiscsi.c | 13 ++++++++++---
 include/scsi/libiscsi.h |  3 +++
 2 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.26.2


             reply	other threads:[~2020-09-25 18:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 18:41 lduncan [this message]
2020-09-25 18:41 ` [PATCH v2 1/1] scsi: libiscsi: fix NOP race condition lduncan
2020-10-02 16:13   ` Lee Duncan
2020-10-08 17:11   ` Mike Christie
2020-10-08 20:54     ` Mike Christie
2020-10-20 16:55       ` Lee Duncan

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=cover.1601058301.git.lduncan@suse.com \
    --to=lduncan@suse.com \
    --cc=hare@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mchristi@redhat.com \
    --cc=open-iscsi@googlegroups.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 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.