The saved pre-fix Cppcheck log reports an unreachable NULL check: scst/src/dev_handlers/scst_user_main.c:1943: style: Condition '!cmd' is always false [knownConditionTrueFalse] The extended-CDB ioctl acquires ucmd_ref before checking whether the command has core state, is still executable, and has been published to userspace or submitted for background execution. A rejected state jumps to the unlock-only path, leaking the reference on every invalid request. The retained command can then prevent device cleanup from completing. Keep hash lookup, state validation and paired user/core reference acquisition in a private helper. On rejection, drop the acquired user reference after releasing cmd_list_lock: its final put can take the same lock while removing the command from the hash. Return a core command only on success, eliminating the unreachable NULL-command cleanup path. The reference leak was found by manual review of the same ioctl while investigating its always-true assertion and error paths. The Cppcheck message above identifies the unreachable check removed here; it does not diagnose the leaked reference. Add eight KUnit cases for sent, background and parsing commands, absent core state, unpublished and completed commands, missing handles and zero-reference hash entries. Verify both counters and the returned core pointer so rejection cannot silently retain either reference.
Overview
This is the source code repository of the SCST project. SCST is a collection of Linux kernel drivers that implement SCSI target functionality. The SCST project includes:
- The SCST core in the scst/ subdirectory.
- A tool for loading, saving and modifying the SCST configuration in directory scstadmin/.
- Several SCSI target drivers in the directories iscsi-scst/, qla2x00t-32gbit/, qla2x00t/, srpt/, scst_local/ and fcst/.
- User space programs in the usr/ subdirectory, e.g. fileio_tgt.
- Various documentation in the doc/ subdirectory.
Documentation
- Building and installing SCST.
- Build options: Clang, cross-compilation, and kernel module signing.
- Configuration and administration: targets, devices,
LUNs, and
/etc/scst.conf. - Core and device handlers: operating modes, module parameters, and sysfs configuration.
- Target drivers: iSCSI, iSER, QLogic Fibre Channel, SRP, FCoE, and local loopback.
- Performance tuning.
- Clustered persistent reservations: synchronization through DLM.
- T10 protection information: data integrity modes and configuration.
- Developer references: architecture and userspace handler interface (SGML sources), and sysfs interface rules.
- Contributing: code style, commit conventions, local checks, and guides to KUnit and component testing.
Current master packages
Prebuilt x86_64 packages from the latest successfully published master
build are available in the rolling
master-rpm prerelease.
These are development snapshots, not SCST releases.
The snapshot contains RPM bundles for selected Rocky Linux and Oracle Linux
UEK kernels. It also contains Ubuntu LTS bundles with scst-dkms, scstadmin
and iscsi-scst binary packages and their Debian source package files. Exact
distribution releases and RPM kernel versions are included in the asset names.
Every .tar.gz bundle has a matching .sha256 file. The complete snapshot is
replaced after each successful package workflow for the current master
commit.
QLogic target driver
Two QLogic target drivers are included in the SCST project.
The default driver is located in the qla2x00t-32gbit directory. It is the newer one.
May anyone wish to switch back to the older driver that only supported up to
16 Gb/s adapters, it is located in qla2x00t directory. To make use of the
older driver build scst with environment variable QLA_32GBIT=no set.
Vladislav Bolkhovitin vst@vlnb.net, http://scst.sourceforge.net
