Skip to content

scst_cmd_set_sn: remove lockless fast path#335

Merged
lnocturno merged 1 commit intoSCST-project:masterfrom
abattersby:remove-lockless-fast-path
Dec 11, 2025
Merged

scst_cmd_set_sn: remove lockless fast path#335
lnocturno merged 1 commit intoSCST-project:masterfrom
abattersby:remove-lockless-fast-path

Conversation

@abattersby
Copy link
Contributor

@abattersby abattersby commented Dec 10, 2025

The lockless fast path for scst_cmd_set_sn() can cause commands to lockup in state EXEC_CHECK_SN when there are multiple scst_tgts accessing the same scst_device, for example two initiators connected to the two ports of a dual-port QLogic FC HBA in target mode both reading from the same shared disk. The multithreaded_init_done value is too low-level for this; it does not take the higher-level configuration into account.

  • Remove the lockless fast path.
  • Remove multithreaded_init_done, which enabled/disabled the lockless fast path.
  • Push the locking down into scst_cmd_set_sn(), which will now apply regardless of set_sn_on_restart_cmd, which matters for mixed-driver (e.g. iSCSI+qla2xxx) target-mode setups.
  • Remove a bunch of comments explaining the rules for the lockless fast path.

Fixes: #333

@abattersby abattersby marked this pull request as draft December 10, 2025 22:09
The lockless fast path for scst_cmd_set_sn() can cause commands to
lockup in state EXEC_CHECK_SN when there are multiple scst_tgts
accessing the same scst_device, for example two initiators
connected to the two ports of a dual-port QLogic FC HBA in target mode
both reading from the same shared disk.  The multithreaded_init_done
value is too low-level for this; it does not take the higher-level
configuration into account.

- Remove the lockless fast path.
- Remove multithreaded_init_done, which enabled/disabled the lockless
  fast path.
- Push the locking down into scst_cmd_set_sn(), which will now apply
  regardless of set_sn_on_restart_cmd, which matters for mixed-driver
  (e.g. iSCSI+qla2xxx) target-mode setups.
- Remove a bunch of comments explaining the rules for the lockless fast
  path.

Fixes: SCST-project#333
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
@abattersby abattersby force-pushed the remove-lockless-fast-path branch from 4259c07 to e35fddb Compare December 10, 2025 22:16
@abattersby abattersby marked this pull request as ready for review December 10, 2025 22:20
@abattersby
Copy link
Contributor Author

I tested with qla2x00t-32gbit but not any other target drivers. Recommend testing with at least iSCSI.

@lnocturno lnocturno merged commit 1a7cfc8 into SCST-project:master Dec 11, 2025
50 checks passed
@lnocturno
Copy link
Contributor

Hi Tony,

Thank you for the patch!

Thanks,
Gleb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multithreaded_init_done needs more work

2 participants