Changing filename while a vdisk is inactive leaves the old backend's thin-provisioning capabilities cached. For example, switching between a plain device and a discard-capable cache can leave automatic thin provisioning disabled or enabled for the wrong backend. Mark only a TP recheck as pending after a successful filename write. Consume it in the common activation path used by active=1 and ALUA. Do not request a full backend reexamination for an existing device: that would also overwrite the exported size and recheck cache mode. The initial deferred reexamination still performs its normal work; if it completes the TP check, activation does not repeat that check. Make the TP probe safe to call repeatedly: - Track successful creation of gen_tp_soft_threshold_reached_UA with tp_ua_attr_created. This avoids duplicate sysfs creation for both thin-to-thin switches and thin-to-non-thin-to-thin round trips. Keep the attribute until device removal; its existing store callback rejects requests while TP is disabled. Failed creation leaves the flag clear so a later probe can retry. - Compare the previous effective TP state and advertised UNMAP limits with vdisk_tp_changed(). Notify on TP enable/disable and on changed granularity, alignment, maximum LBA count or discard-zeroes behavior while TP remains enabled. Ignore stale limits while TP is disabled. - Keep the requested manual TP setting separate from the effective backend capability. An explicit thin_provisioned=0 stays disabled. An explicit thin_provisioned=1 is temporarily disabled on a backend without TP and restored when a later backend supports it. Reusing the effective value as the request would lose that setting on a thin-to-non-thin-to-thin round trip. - On a probe-open error, leave the previous capabilities and pending flag intact. Activation closes any reopened descriptors and returns the device to inactive state so a subsequent activation can retry. Filename replacement, explicit activation and ALUA activation already serialize through scst_alua_lock(). Use that same lock for the new state so another filename write cannot race with consuming the pending check. Keep the new bool fields outside the command-side bitfields to avoid sharing their read-modify-write storage with command callbacks. Queue INQUIRY DATA HAS CHANGED through vdev_inq_changed_work. Calling scst_dev_inquiry_data_changed() directly from activation could recurse on scst_mutex. The existing device-free callback cancels this work before releasing the device. Ordinary ALUA or active cycles without a filename write do not request another TP probe or notification. Link: https://github.com/SCST-project/scst/pull/389
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.
Instructions for building and installing SCST are available in the INSTALL.md file.
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
