The saved pre-fix Cppcheck log reports: scst/src/scst_lib.c:4170: style: Redundant initialization for 'res'. The initialized value is overwritten before it is read. [redundantInitialization] The diagnostic points to the lost -EOVERFLOW result. Manual review of the same function additionally found the cursor wraparound failures below; those are not separate analyzer diagnostics. gen_relative_target_port_id has two boundary failures. Returning ID 65535 increments the static cursor to 65536 without wrapping it. The next uniqueness check truncates that value to u16, allowing reserved ID zero to be returned. If the range is occupied, the invalid saved cursor can also prevent the search from completing a full cycle. The initial -EOVERFLOW value is separately overwritten by successful mutex_lock_interruptible. Exhausting a valid range then returns success without assigning an ID, allowing target enable to continue incorrectly. Advance and wrap the cursor before every successful return. Search each valid candidate once and return -EOVERFLOW if none is available, leaving the caller's output and cursor unchanged on failure. Keep serialization under scst_mutex in the existing entry point. Add KUnit cases for the first candidate, occupied candidates, allocation of the last ID, wrap to ID 1 and complete exhaustion. Stub uniqueness checks per test task so the tests do not modify the global target list.
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
