Skip to content

scsi: libiscsi: fix NOP race condition

[email protected] linux-scsi lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 4 repliesIn review
  2. v11 patch 0 repliesSuperseded

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1scsi: libiscsi: fix NOP race conditiondrivers/scsi/libiscsi.c include/scsi/libiscsi.h+13 -34 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/1] scsi: libiscsi: fix NOP race condition

From: Lee Duncan <[email protected]>

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(-)
Signature · 1 line
2.26.2