Keep explicitly listed files as separate array elements instead of
joining them into one invalid path. Use pipefail so an input-listing
error cannot be hidden by tar.
Write the specialized patch unchanged when diffstat is unavailable,
instead of creating an empty file. Propagate specialization,
output-directory, and generated-header failures to the caller.
Treat status 1 from diff as successful when generating QLogic in-tree
patches, while continuing to propagate actual diff failures.
Propagate patch, source-copy, and patch-generation failures instead
of continuing with incomplete regression inputs. Stop immediately
when the output directory cannot be created.
Also correct the documented options and keep Debian package output
in its intended log file.
Download kernel archives through a temporary file, validate XZ data,
and only publish complete files. Reject corrupt cached downloads and
propagate XZ pipeline failures during extraction and patching.
Wire the regression runner cache option to the kernel_downloads
variable used by the shared download helpers.
Fail the QLogic documentation check when tidy is unavailable or any
HTML file does not validate. Mark both HTML check targets as phony so
a file named check cannot silently suppress validation.
Keep user-provided maintainer identity values and only install the
defaults when these variables are empty. Generate debian/compat only
after dpkg-query succeeds so a failed query cannot leave an empty file.
Do not update the build_mode file while make is only expanding the
recipe, since that also happens for dry runs. Run the update as the
recipe itself so write failures are reported to the caller.
Return the failing submake status from the top-level and Debian build
loops instead of turning an early failure into success. Collect and
check the statuses of the parallel iSCSI and SRP cleanup jobs as well.
Remove the obsolete Piwik integration that loads a project page as
JavaScript and breaks every top-level page.
Replace unavailable company logos with stable text links, remove the
unused tooltip code, and update the stale zero-copy reference. Make the
website check fail when tidy is unavailable or reports an error.
Move the minimum kernel check into the shared backport header so all
kernel components reject Linux versions older than 3.10 and RHEL 6.
Simplify now-unreachable compatibility conditions and remove the unused
QLogic patch for Linux 2.6.26 and 2.6.27.
Reject unsupported kernel versions before download or patch generation.
Remove 2.x paths, RHEL 5/6 and Scientific Linux repositories, and
compatibility branches that cannot run with the Linux 3.10 minimum.
Keep the maintained ABT_KERNELS matrix unchanged.
GNU Awk 5.4 rejects unescaped repetition operators at the start of a
regular expression and C-style comments in the program text. Escape the
literal diff markers and use an Awk comment so patch specialization
works with current GNU Awk.
The generated SRPT documentation still contained commands for the removed
/proc/scsi_tgt interface. The comparison page advertised procfs as an SCST
option and Debian metadata named deleted procfs sources. Remove these stale
references while retaining scstadmin migration support.
Procfs support was removed in 2019, but dead configuration guards,
patch specialization logic and unused declarations remained. Remove these
remnants and simplify paths that can no longer receive procfs-only objects.
The website links to stale deployed manuals, generated pages and
a QLogic snapshot that is not in the repository. Several feature
summaries also describe code that has since changed or disappeared.
Commit 7aade0a109 ("Makefile: Make the qla2x00t-32gbit driver
the default QLogic FC driver") changed the default QLogic tree.
Commit 3a8d70b166 ("- Remove old scst_db stuff which no longer works
with even procfs.") removed database-backed scstadmin configuration.
Commit d84fc0783d ("vdisk_fileio: Add support for asynchronous I/O
processing") removed O_DIRECT as a fileio_tgt-only distinction.
Linux commit 066465251303 ("tgt: removal") removed scsi_tgt in 2014,
turning the website prediction into a completed historical event.
Commit 10ebf80e7a ("Docs update") merged the SGV cache text into
doc/scst_pg.sgml.
Link website entries to maintained repository sources, use the real
lowercase make rpm target, update the affected feature descriptions
and remove references to files that are not tracked.
The scst_local README omits exported attributes, claims dynamic sessions
cannot be saved and uses an invalid module path. Its walkthrough also
creates and exports a writable backing file on the same host without
a safety boundary.
Commit 84d335f131 ("scst_local: Make the SCSI host number available
in sysfs") added host_no. Commit 00caf4d5c9 ("scstadmin: Make
-write_config save the scst_local session name") added the missing
serialization.
Document host_no and version from scst_local.c and remove the obsolete
session warning. Use ./scst_local.ko, fix the malformed sysfs path and
explain that add_default_tgt=0 suppresses default objects. Require
an isolated host and disposable backing path while retaining the
recursion, mount and swap restrictions.
The FCST setup has stale step references and an invalid target enable
path. A reader following it reaches the wrong prerequisites and cannot
address enabled after entering the target directory.
Commit 87bde8ab0e ("fcst/README: Update this README file") shortened
the procedure without updating its cross-references. Commit 7a12737c9d
("Simplify README by eliminating example using of ini_groups.") changed
the LUN setup but left $LPORT duplicated in the following path.
Repair the references, terminology and relative enable command,
and clarify the LUN 0 compatibility note. The same procedure installs
packages, creates an FCoE interface, loads modules and exports storage,
so require authorization for the host, CNA, fabric, initiators and
backing devices before it is run.
The legacy and newer QLogic guides disagree about the default driver,
supported adapters, NPIV, sysfs layout and module lifecycle. The
HOWTO also carries SVN, kernel replacement, firmware flashing and
discovery commands that can disrupt active storage.
Commit 7aade0a109 ("Makefile: Make the qla2x00t-32gbit driver
the default QLogic FC driver") selected the newer tree by default.
Commit a788a4efd7 ("Newer version of QLogic target driver with 16G
(26xx/83xx) support") added that tree and disabled legacy NPIV target
callbacks. Commit 08e532715d ("Remove procfs support") removed the
old management path.
Use each qla2xxx_pci_tbl[] and qla_os.c for hardware and firmware facts.
Document QLA_32GBIT=no, current per-port sysfs state, reset effects
and the matched qla2xxx_scst and qla2x00tgt modules. Replace unsafe
generic recipes with repository or vendor sources and mark every HBA,
fabric, target and backing-device operation as live.
The SRPT guides mix current RDMA/CM code with Linux 2.6, procfs and
OFED 1.5 procedures. Their parameter defaults, session names and
tuning advice no longer describe the driver built by this tree.
Commit 020ec68ddc ("ib_srpt: Change default behavior from using SRQ
to not using SRQ") changed receive queues, and commit 434207ab53
("ib_srpt: Restore immediate data support") changed request sizing.
Commit fa58faf95b ("ib_srpt: Add RDMA/CM support") added the IP-based
session naming mode.
Commit 08e532715d ("Remove procfs support") invalidated the in-tree
setup, while commit d6fd03107f ("Split Makefiles: move kernel build
rules into Kbuild files") moved the fault-injection flag.
Commit c2bd2e8bf5 ("ib_srpt: Remove "thread" kernel module parameter and keep thread=1 behavior - the other two modes could cause soft lockup complaints")
made threaded completion unconditional.
Use ib_srpt.c, ib_srpt.h and conftests for current behavior. Scope
SCSI multiqueue advice after Linux commit f664a3cc17b7 ("scsi: kill
off the legacy IO path"), and mark OFED, HA, benchmark and test
recipes as historical or destructive.
The scstadmin manuals still describe the 2.0 parser, a database backend
and SysV-only service integration. They omit current ALUA operations
and call -check_config an offline check even though it reads live sysfs.
Commit 3a8d70b166 ("- Remove old scst_db stuff which no longer
works with even procfs.") removed the database implementation. The
current grammar and apply order live in scstadmin.sysfs/scstadmin,
while SCST/SCST.pm consumes the kernel-provided sysfs metadata.
Document the current commands, quoting, comments, DEVICE references
and systemd environment handling. Keep deprecated-format conversion,
but explain that it reconciles live state. Mark conversion, checking,
examples, installation and service operations with their root, sysfs
and exported-storage effects.
The iSER and distribution guides prescribe OFED 1.5 installation,
deleting packaged RDMA modules, patching kernel builds and applying
host-wide tuning. The Gentoo procedure targets SVN, while the bundled
OCF agents are neither built nor exercised by repository CI.
Commit 025574018e ("isert: Support building against MOFED without
patching the kernel build system") established the supported
header-selection model. Current Makefile conftests and isert-scst
sources define the remaining compatibility and transport limits.
Replace fixed OFED and tuning recipes with those sources and matching
vendor guidance. Reduce the Gentoo and resource-agent documents to
historical integration notes, and spell out their module, sysfs,
daemon, session and storage side effects before any reuse.
The iSCSI READMEs, HOWTO and man pages combine current code with procfs,
old daemon configuration and fixed runtime output. The result documents
invalid paths, the wrong object creation order and unsafe live commands.
Commit 08e532715d ("Remove procfs support") removed the main obsolete
interface. Commit 70eb596f60 ("Rework iSCSI aborts to make them more
correct and remove recent workarounds (one more post-IET cleanup)")
added the SCST abort callback requested by an old ToDo entry.
Use iscsi_scst.h, kernel/config.c and usr/config.c for the kernel and
daemon contract. Correct sysfs ownership, authentication limits, setup
ordering, logging and dynamic output, and remove the completed task.
Keep iscsi-scstd.conf and iscsi-scst-adm documented because current code
still consumes them, but direct new setups to scst.conf. Replace the
removed service command and warn before exposing storage, credentials,
portals or sessions.
The scst_user specification copies ioctl structures and command payloads
that predate several ABI extensions. Building a handler from those
layouts can select the wrong union member, alignment or completion path.
Commit 3fc775c75a ("EXTENDED COPY support") added remapping payloads.
Commit daee4dcb7e ("WRITE SAME command improvements") added WRITE
SAME descriptors. Commit d1bd22afd9 ("scst_user: avoid global locks")
left the explicit unregister ioctl as an obsolete no-op.
Use scst/include/scst_user.h and scst_user.c as the producer-side
source of truth. Synchronize registration, command, reply and subcommand
layouts, version checks, reserved fields and ioctl rules.
Update the fileio_tgt, stpgd and event guides from current code. Make
live-storage and event-consumption risks explicit.
The programming guide presents copied structure layouts, callbacks
and management paths as current interfaces. API and build changes have
left those copies describing fields and operations that no longer exist.
Commit 08e532715d ("Remove procfs support") removed the documented
procfs callbacks and paths. Commit 2090b6811a ("qla2x00t: remove
detect() callback") moved QLogic setup out of the template detect hook.
Make scst/include/scst.h and scst/SysfsRules authoritative, and label
embedded declarations as historical outlines. Update callback names,
QLogic initialization, sysfs trace commands and build modes.
The supported kernels in nightly/conf/nightly.conf also span different
Kconfig and logging interfaces. Refer readers to the exact target
kernel instead of prescribing fixed debug symbols, buffer limits and
syslog paths.
README.dlm embeds a 2015 Pacemaker recipe that disables quorum and
fencing. README.drbd also says persistent reservation state is never
shared between nodes. The first is unsafe for shared storage and the
second contradicts the current cluster_mode implementation.
Commit 6420070cb9 ("scst: Synchronize persistent reservation
state between cluster nodes") added DLM-backed reservation
synchronization. The current contract lives in scst_dlm.c and
scst_pres.c, while fencing and resource-manager policy remain
outside SCST.
Replace the fixed Pacemaker commands with DLM dependencies and startup
and shutdown ordering. Require fencing, describe cluster_mode, retain
the DRBD protocol C requirement and leave multipath policy to the
installed initiator stack.
The core guides have drifted across VDISK, sysfs, build modes,
performance tuning and cache semantics. Some advice requires removed
kernel patches, prescribes CFQ unconditionally, or treats volatile
write-back data as durable.
Use scst_vdisk.c for backend options, current sysfs code for attributes,
scst/Makefile for build_mode.h and nightly/conf/nightly.conf for
the kernel support boundary. Correct the enabled and tgt tokens and
document the T10-PI protection SG count.
Commit 9a0c18aa1c ("scst: Disable I/O context sharing for kernel
v4.21 and later kernels") limits I/O grouping to old kernels. Linux
commit f664a3cc17b7 ("scsi: kill off the legacy IO path") also makes
CFQ advice invalid for current kernels.
Commit d84fc0783d ("vdisk_fileio: Add support for asynchronous
I/O processing") added direct I/O to VDISK, and commit 3fc775c75a
("EXTENDED COPY support") implemented another open ToDo item. Remove
both completed tasks and replace stale performance and durability
claims with behavior derived from the current stack.
README.performance runs fio against a block device, exports LUNs, logs
in iSCSI sessions and may enable multipath. Its placeholders look
copyable, but using the wrong path or host can overwrite storage and
change both target and initiator state.
Put an explicit safety boundary before the first command. Require
authorization for the exact hosts, transports and configuration, and
allow the workflow only with verified disposable backing devices.
All four AskingQuestions copies direct users to the removed top-level
Linux REPORTING-BUGS file. They also present reports built around Linux
2.6, procfs and obsolete module names without an age marker.
Point each copy at
Documentation/admin-guide/reporting-issues.rst, the current kernel
reporting guide. Keep the old reports as examples of useful diagnostic
detail, but label them historical so their commands are not reused as
SCST setup instructions.
The top-level guides still describe retired source, QLogic, service and
kernel-support workflows. Following them can select the wrong driver,
cross-compile only part of the tree, or misstate module-signing policy.
Commit 7aade0a109 ("Makefile: Make the qla2x00t-32gbit driver
the default QLogic FC driver") made the newer tree the default.
Commit 0d3c9018af ("debian, scstadmin: Add systemd scst.service")
added the installed systemd unit.
Point source users at GitHub and kernel support at
nightly/conf/nightly.conf. Separate kernel and user-space cross builds,
follow the current service recipes, and make module acceptance depend
on the target kernel and platform policy.
Add repository-local skills for developing, linting, and independently
reviewing committed SCST patch ranges.
Keep lint in the main agent, require it before a terminal read-only
reviewer, and bound review-driven revisions to three attempts.
SCST spans a kernel core, transport drivers, user-space programs and
configuration tools. Each area has different ABI, build, validation and
safety constraints, but the repository has no persistent guidance for
automated contributors.
Add a root AGENTS.md with cross-component contracts and nested files for
components with independent boundaries. Record authoritative sources,
generated files, compatibility policy and destructive workflows so
changes start from the correct context and avoid live storage state.
Fixes a regression introduced in f4f8da8 (#217, v3.9.0): applying a config file disables enabled targets that are not listed in the file at all, without `-force`.
Reproduction and analysis:
https://github.com/SCST-project/scst/pull/217#issuecomment-4977852242
The comparison code accidentally adds targets that are not mentioned in the config file to the parsed config and applyConfigEnableTargets() then disables them. On qla2x00t this flaps the FC port, and if the target was already disabled, the write fails and the whole apply aborts with FATAL.
With this patch such targets are disabled only with `-force` (like LUNs, groups and initiators), already disabled ones are skipped, and without `-force` only a message is printed. The `-force` use case from #217 works as before.
The device cleanup loop in dev_user_process_cleanup() spins at ~2 million
iterations per second and never exits, ultimately triggering a kernel soft
lockup. The previous workaround panicked the system after 10,000
iterations.
Root cause (confirmed by instrumentation):
A ucmd gets permanently stuck in ucmd_hash with:
state = UCMD_STATE_ON_FREE_SKIPPED (7)
cmd = NULL
ref = 1
sent_to_user = 0
The stuck ref=1 is the reference taken by dev_user_alloc_pages() via
ucmd_get() for the first scatter-gather page. It is released only by
dev_user_free_sg_entries() → ucmd_put(), which fires when the SGV pool
*evicts* a cached object. The sequence that prevents this eviction:
1. dev_user_unjam_dev() finds an EXECING command (sent_to_user=1,
ref=2: alloc + alloc_pages), bumps ref to 3 via ucmd_get_check(),
then calls dev_user_unjam_cmd().
2. dev_user_unjam_cmd() releases cmd_list_lock and calls
scst_cmd_done(SCST_CONTEXT_THREAD), which synchronously runs the
full SCST completion pipeline:
dev_user_on_free_cmd()
ucmd->cmd = NULL
ucmd->state = UCMD_STATE_ON_FREE_SKIPPED (type == IGNORE)
dev_user_process_reply_on_free()
dev_user_free_sgv()
sgv_pool_free(ucmd->sgv)
/* SGV cached on pool LRU; dev_user_free_sg_entries()
* not called; alloc_pages ucmd_get() not balanced */
ucmd->sgv = NULL
ucmd_put() ← ref: 3→2
3. Back in dev_user_unjam_dev(): ucmd_put() ← ref: 2→1.
ref != 0, so dev_user_free_ucmd() / cmd_remove_hash() are NOT called.
ucmd remains in ucmd_hash.
4. unjam_cmd also reset sent_to_user=0, so on every subsequent pass
through dev_user_unjam_dev() the ucmd is counted (res++) but skipped
(!sent_to_user → continue). dev_user_get_next_cmd() returns -EAGAIN
(ucmd is not in ready_cmd_list). With cleanup_done=1 the while(1)
loop has no exit condition.
The sgv_pool_flush() calls at the TOP of dev_user_unjam_dev() run
BEFORE any commands are unjammed. SGV objects cached during unjamming
are therefore never flushed; dev_user_free_sg_entries() never fires.
Fix:
Add sgv_pool_flush() for both pools at the BOTTOM of
dev_user_unjam_dev(), after the spinlock is released. This evicts
all SGV objects cached during unjamming, triggering:
dev_user_free_sg_entries() → ucmd_put() → dev_user_free_ucmd()
→ cmd_remove_hash()
removing the stuck ucmd from the hash. On the next cleanup-loop iteration
dev_user_unjam_dev() returns res=0 and dev_user_process_cleanup() breaks.
sgv_pool_flush() is fully synchronous (calls sgv_dtor_and_free() inline);
by the time it returns the callbacks have already fired and the ucmd has
already been removed from the hash. No schedule() or sleep is needed.
Change the memory allocation for qp_cpu_map to use the actual number of
CPUs ('nr_cpu_ids') instead of the maximum possible CPUs ('NR_CPUS').
This saves memory on systems where the maximum CPU limit is much higher
than the active CPU count.
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260331053245.1839-1-lirongqing@baidu.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 271aeff266c9 upstream ]
MPI firmware state was returned as 0. Get MPI FW state to proceed with
flash image validation.
A new sysfs node 'mpi_fw_state' is added to report MPI firmware state:
/sys/class/scsi_host/hostXX/mpi_fw_state
Fixes: d74181ca110e ("scsi: qla2xxx: Add bsg interface to support firmware img validation")
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://patch.msgid.link/20260305093337.2007205-1-njavali@marvell.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 0e124af675eb upstream ]
Rocky Linux kernel rebuilds can append an extra release suffix to the
source RPM name. For example, kernel-5.14.0-687.10.1.el9_8.0.1.src.rpm can
still contain a linux-5.14.0-687.10.1.el9_8.tar.* source archive.
The exact linux-${kver}*.tar.* match then fails before the source tree
can be extracted.
Look for the archive name again with a trailing .0.N rebuild suffix
removed and keep renaming the extracted tree to the full requested kernel
release, so later paths remain unchanged.
When scst_dlm_unlock_wait() timed out, the caller could proceed to
free the containing storage of @lksb while DLM still held a reference
to it in lkb->lkb_lksb. A subsequently delivered AST -- e.g. a
recovery-synthesized UNLOCK_REPLY for a departed peer -- would then
write sb_status into freed memory.
Make scst_dlm_remove_lock() honor its contract on every path: after
the convert-to-NL clean-release step, issue
dlm_unlock(DLM_LKF_FORCEUNLOCK) and loop on the completion until a
destroying CAST (sb_status == -DLM_EUNLOCK) is observed. FORCEUNLOCK
ensures that such a CAST arrives even if an earlier operation is
still in flight or a peer is departing, since
dlm_recover_waiters_pre() synthesizes the reply in the latter case.
Non-destroying CASTs from previously canceled converts are logged
and the wait continues.
Route the per-registrant teardown (scst_dlm_pr_rm_reg_ls), the
remote-UA teardown (scst_dlm_rm_rem_ua_ls), and the remaining
stack-allocated lksb teardown sites through scst_dlm_remove_lock()
so they all observe the destroying CAST before their storage may
be reused. As a side benefit, those sites gain the convert-to-NL
step that preserves LVB validity on peers per the DLM EX/PW
release rule.
Wire the on_alua_state_change_{start,finish} callbacks into
vdisk_file_devtype and expose bind_alua_state as a sysfs attribute
and create-time parameter for fileio. The callback bodies were
already backing-agnostic; rename them from blockio_* to vdev_* to
match.
Default bind_alua_state=0 for fileio (vs. 1 for blockio) to preserve
existing behavior on upgrade. Adjust the sysfs show function to
compare against the per-backing default so scstadmin persists
explicit settings correctly.
Follow-up to commit a4a55aab41 ("scst: add async_lun_replace to defer
tgt_dev cleanup after LUN replace"), which moved the slow drain of
old tgt_devs off the LUN-replace management write path.
That defers the drain. It does not defer the free - the asynchronous
worker still acquires scst_mutex to call scst_free_tgt_dev, and that
function's first action, scst_clear_reservation -> scst_dlm_res_lock,
does a DLM round-trip. When the peer node has just died and has not
yet been evicted from the lockspace, that round-trip stalls in
scst_dlm_lock_wait. With scst_mutex held by the stalled worker,
every subsequent LUN-replace management write queues behind it.
When async_lun_replace=1, scst_acg_repl_lun() now parks the deferred
cleanup of old tgt_devs on a list instead of scheduling it on the
workqueue immediately. Writing 0 to the async_lun_replace sysfs knob
releases the parked work in a batch.
This lets the orchestrating layer hold cleanup until any cluster
coordination it depends on (e.g. DLM peer eviction during HA failover)
has completed.
Module unload calls scst_async_lun_replace_set(false) as a safety net.
Validate the configured vdisk_blockio block size against the backend
block device during open using bdev_validate_blocksize().
This rejects incompatible configurations early and prevents misaligned
I/O from reaching the backend device.