Commit Graph
9413 Commits
Author SHA1 Message Date
Gleb Chesnokov bc20ee1ca1 kunit: Test event import, delivery and timeout accounting
Move the existing client layout into a private header and link
separate suites with shared fixtures. Add task-scoped usercopy and
allocation boundaries around the actual ioctl and timeout paths.

Use private clients without scheduling work or accessing userspace
memory. Preserve payload validation and counter behavior; the
delivered-timeout assertion exposes the existing double decrement.

Include the private event headers needed by ordinary in-tree builds
in generated kernel patches.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov bd6671cdda kunit: Test command ordering with bounded worker teardown
Exercise queue policy, barriers, sequence wrap, slot ownership and
concurrent producers through a private declaration of the existing
ordering function.

Keep worker memory outside KUnit-managed resources and pin the module
until completion. Bound teardown waits and report retained state when
a worker cannot finish.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov 82d9a42ec5 kunit: Test CDB decoding and direction contracts
Link a separate CDB test object with private access to command
parsing. Exercise tape and disk transfer decoding, REWIND and
initiator direction checks on private commands without altering
production behavior.

Provide private device, target-device and session state required by
command parsing, and optional logs of decoded direction expectations.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov de6f96695f kunit: Test UNMAP parsing and atomic overlap boundaries
Give the separate UNMAP suite private access to the actual overlap
function. Check parser and consumer contracts without changing
validation or descriptor traversal.

Bind each command's CDB pointer to its private buffer and provide a
private session for allocation-failure status handling.

Use allocated guard descriptors to expose count violations safely.
Expect incomplete final descriptors to be ignored while preserving
complete descriptors, including when the CDB truncates the list. Stop
sense and descriptor checks if the parser returns an unexpected status.
Keep correct-result assertions for existing failures and explicitly skip
short-transfer cases that could read beyond the baseline buffer.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov 0ebd6c3328 kunit: Test ALUA callback delivery with private groups
Exercise state transitions with unregistered groups, devices and
mappings. Check per-device callback delivery, ordering, optional
callbacks and unchanged or invalid states without changing ALUA
behavior.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov d89f53368b kunit: Add full test builds and label-based execution
Provide kunit-build for all test-owning modules and their dependencies,
kunit-run for existing artifacts, and kunit-test for a sequential build
and run even under make -j. Allow root builds and run every command with
the caller's privileges. Require root for module execution.

Map KUNIT_TEST and KUNIT_LOG to private Kbuild switches. Default
KUNIT_LABEL to ALL and use KUNIT_ARGS for other runner options and
module paths. Resolve artifacts from explicit arguments, configuration
or the recorded build, preserving spaces. Group and align the Makefile
help for component tests, KUnit and ordinary build targets.

Read label-to-suite mappings and dependency order from module metadata,
without a separate Python owner registry. Reject dependency cycles and
missing SCST core artifacts. Load external kernel dependencies with
modprobe before preparing KUnit; keep shared system
modules loaded. Load only selected SCST owners and their dependencies
from the supplied build and trigger suites through native KUnit debugfs.

Support built-in and modular KUnit with autorun disabled. Load modular
KUnit with known parameters when absent and release it after SCST
cleanup or a clean initial load failure. Reuse an existing instance only
after validating its effective parameters in sysfs; reject invalid or
unreadable values without changing the module. Never unload preloaded
KUnit. Check global filters before loading SCST.

Capture fresh kernel records and parse suites with the upstream KTAP
parser. Preserve logs and skip reasons, associating first-parameter
diagnostics with their case without changing plans or results. Stop
module operations on incomplete evidence, diagnostics or retained
fixtures. Continue after ordinary assertion failures. Finish capturing
output after command exit. Distinguish suites not started from missing
results, and count each Oops as one event. Print concise errors and
colored terminal statuses as suites finish. Group failure details after
progress. Normalize each assertion block independently of printk
messages while retaining value indentation. Follow with explicit stop
reasons and a compact SCST build summary. Reserve module headings,
author, license, source checksums, vermagic and other modules for
verbose output. Keep full case logs, module metadata and kernel
diagnostics in plain-text and JSON reports.

Cover build ordering, selection, kernel setup, dependency preparation,
runner lifecycle and reporting with mocked operations. Document VM
setup, build, execution and extension in the KUnit guide.

Add kunit-clean for test-owning component builds. Invalidate the recorded
module list and clear tooling caches on ordinary and component clean
paths too, including failed cleanup. Preserve reports and user settings.

Check all tooling, kunit-build and cleanup in one CI job. Pin the
Fedora container by digest and fetch a fixed kernel-devel package from
Koji with a SHA-256 check, independently of the regression matrix.
Save build evidence without building a kernel or loading modules.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov 6a3bef807b kunit: Import the public Linux KTAP parser
Vendor the unmodified public Linux master parser and printer with
provenance and checksums. Keep SCST module execution policy outside
these files.

Pin upstream commit 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov c3070172c7 kunit: Add a shared test switch and a core library suite
Integrate optional native KUnit suites with out-of-tree SCST modules.
A single CONFIG_SCST_KUNIT_TEST switch includes all test objects of
each owner. Declare each suite name and label once and discover source
registrations for kunit-list without a build or loaded modules.
Preserve ordinary builds without KUnit.

Start with a fixed-wire LUN regression. Centralize private visibility
and task-scoped static-stub switches, and define retained-fixture
reporting for asynchronous tests. Use current native KUnit APIs
without compatibility shims. Keep optional execution messages behind
CONFIG_SCST_KUNIT_LOG while leaving failure diagnostics unconditional.

Add Makefile/Kbuild regression checks and document the shared switch.

Keep compatibility builds free of KUnit, including inherited test
options and allmodconfig. Generate ordinary in-tree SCST patches with
private declarations but without test suites or KUnit build options.
Check this boundary and preserve kernels without an unwinder option.
2026-10-14 15:08:03 +03:00
Gleb Chesnokov c0e118e739 docs: Define contribution rules and local static checks
Document SCST additions to the Linux kernel coding and commit style,
including a prefix registry and optional sign-off. Configure Conform for
kernel-style subjects and list applicable pre-handoff checks in AGENTS.md.

Use the existing checkpatch and ShellCheck entry points. Document direct
Conform invocations for commit ranges and message files in linked
worktrees, without introducing another checking script.

Keep the existing CI workflows and checkpatch exclusions unchanged.
2026-10-13 13:56:16 +03:00
Gleb Chesnokov af9ecd7a07 docs: Simplify repository guidance for agents
Trim repeated source-of-truth guidance and route documentation by topic.
Preserve the architecture map, cross-component contracts, build context,
compatibility policy, generated-state rules and live-host boundaries.
2026-10-13 12:42:36 +03:00
Gleb Chesnokov fad988d842 .gitignore: Ignore Codegraph generated files
Ignore the Codegraph cache directory, database and database sidecars so
local indexing artifacts do not appear as source changes.
2026-10-13 12:42:36 +03:00
Gleb Chesnokov e69138598e tests: Verify local and iSCSI I/O with fio
Run one fio profile with concurrent 4K, 64K and 128K jobs in disjoint
regions. Cover buffered fileio with 512-byte sectors and direct blockio
with 4K sectors. Verify CRC32C data and completed byte counts, and follow
buffered I/O with direct verification to bypass the initiator page cache.

Reuse the SCSI fixtures and exported-device checks for both transports.
Require an explicit target block device and check its use and signatures
before exporting it. Configure the per-job region size and I/O timeout,
and retain rendered job files, JSON reports and stderr.

Cover job rendering and report validation with framework tests. Document
fio prerequisites, destructive scope and label selection through the
common Make targets.
2026-10-13 12:42:36 +03:00
Gleb Chesnokov 1f48a4f400 tests: Cover SCSI commands on local and iSCSI targets
Add shared sg3_utils scenarios for scst_local and iSCSI exports: inquiry
and VPD identity, capacity, LUN visibility, write protection and invalid
LBA handling. Require the expected SCSI status and raw sense for rejected
commands, then verify that valid reads still work.

Use temporary fileio backends with 512-byte sectors. Keep fixture
identifiers within vdisk's 20-character USN limit. Match each exported
device to its fixture by identity and geometry before submitting commands.
Carry binary responses over the existing supervised command transports
and retain fixture ownership through successful cleanup.

Add framework checks for response parsing, device selection and command
interruption. Document tool prerequisites and the scsi label for both
transports through the common Make targets.
2026-10-13 12:42:36 +03:00
Gleb Chesnokov 41e6caeebc tests: Add two-host iSCSI component tests
Run Ginkgo on the target and drive a separate Open-iSCSI initiator over
SSH. Keep host locks, bounded command logs and failure latches on both
sides. Load checkout modules, own the foreground target daemon, and
remove sessions and node records before tearing down target resources.

Add discovery, login/logout, repeated login, portal filtering and CHAP
scenarios. Offer each CHAP algorithm separately and verify recovery after
an authentication rejection. Use dummy LUNs and per-run initiator IQNs
without changing the initiator's global configuration.

Register the iSCSI group with the shared runner and validate every
selected host before starting the first suite. Finish local teardown
before starting iSCSI tests and stop after any suite failure. Extend the
configuration examples and guide with initiator setup and cleanup limits.
2026-10-13 12:42:36 +03:00
Gleb Chesnokov 40c3ead2db tests: Extend single-host SCST component coverage
Cover fileio activation and configuration persistence, local ALUA state
changes, relative target IDs, live-session group changes and copy-manager
rollback through scstadmin. Manage temporary backing files with device
cleanup and assert the session LUN maps exposed by the CLI.

Add configurable group/device churn and many-LUN teardown scenarios.
Keep the inactive-fileio sync reproducer behind an explicit opt-in
because it can crash affected kernels. Document the new configuration
options and test labels.
2026-10-13 12:42:36 +03:00
Gleb Chesnokov feab01b85b tests: Add SCST component tests with Ginkgo
Add component tests for the scstadmin management interface, including
state preservation after rejected commands. Use scst_local and
vdisk_nullio to cover devices, targets, LUN mappings, initiator groups,
ALUA and configuration save/restore without physical storage.

Provide a shared runner with explicit configuration, host locking,
bounded command logs and JSON/JUnit reports. Select specs through labels
and focus before preparing the host, and reject empty selections. Parse
scstadmin output, including session attributes and LUN mappings, through
common helpers covered by framework tests.

Load checkout modules in suite setup, optionally build them first, and
unload them after successful cleanup. Add common Make targets for
framework checks, test selection and live runs, with setup documentation.
2026-10-13 12:42:36 +03:00
Gleb Chesnokov 9041f8518d scstadmin: Fix status when target creation attributes are absent
Drivers such as iSCSI do not advertise target creation attributes.
-list_drv_attr still prints their attributes but returns failure when
that optional list is empty, aborting callers that check its exit status.

Return success for an empty list after checking for retrieval errors.
2026-10-13 12:42:36 +03:00
wenlxieandGleb Chesnokov 6ddf82829e scst_user: yield cleanup while shared SGV remains checked out
With SGV sharing, device B can reuse a buffer whose allocation owner is
a command from device A. If A's user handle closes while B still has the
SGV checked out, A's command remains in its hash. The unjam pass sees
that command, but there is no ready A command, so get_next_cmd() returns
-EAGAIN. Once cleanup_done is set, the old inner loop keeps retrying A
and prevents the single cleanup worker from reaching B.

The post-unjam pool flush added by PR #378 frees SGV objects that have
already returned to the recycling lists. It cannot free the object
still checked out by B, so it cannot resolve this dependency.

Yield A to the outer cleanup loop when no ready command exists but the
unjam pass still reports commands. The worker can process B and retry A
after its normal sleep. Signal A's cleanup completion only when its
release is done and no commands remain.

Link: https://github.com/SCST-project/scst/issues/279
2026-10-02 09:40:21 +03:00
Gleb Chesnokov 5908a8da46 scst_vdisk: Refresh thin provisioning after backend changes
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
2026-09-28 12:32:17 +03:00
Gleb Chesnokov 412a35f15b Remove repository AI workflow
Remove the patch-development skills and Codex reviewer role from the
master baseline. Keep all AGENTS.md files as repository guidance.

Signed-off-by: Gleb Chesnokov <gleb.chesnokov@scst.dev>
2026-09-17 14:38:32 +03:00
Gleb Chesnokov 487b52c2f9 scripts/specialize-patch: Rebuild filtered hunks
The regression became visible after commit 91517609cd
("scripts/generate-kernel-patch: Preserve split patches") preserved split
output that had previously been empty without diffstat.
specialize-patch kept the original hunk coordinates after dropping
version-dependent lines, so GNU patch rejected the generated qla.h patch.

Recalculate hunk coordinates and context after specialization removes added
lines. This prevents GNU patch from rejecting QLogic qla.h hunks for Linux
7.1 and 7.2.

Add a focused regression test for the normal and matching-line-number
specialization modes.
2026-08-26 16:25:41 +03:00
Gleb Chesnokov 3c7a6df0a8 .github/workflows: Trust Ubuntu package checkout
Mark the mounted GitHub workspace as a safe Git directory inside Ubuntu
package containers.

This keeps tracked source enumeration and version metadata available to
make dpkg.
2026-08-25 14:24:22 +03:00
Gleb Chesnokov 726f91559c .github/workflows: Skip disabled regression analyzers
Do not install sparse or build smatch in jobs that disable both.

Check for each tool only when the corresponding analysis is enabled.
2026-08-25 14:24:22 +03:00
Gleb Chesnokov 06857c81cb .github/workflows: Build Ubuntu 20.04 packages
Build Ubuntu 20.04 and 24.04 DEB artifacts in release-specific job
containers with explicit kernel headers.

Publish one bundle per Ubuntu LTS target and keep the README independent of
matrix versions.
2026-08-25 14:24:22 +03:00
Gleb Chesnokov 934fd4e6d1 scripts: Add kernel versions to RPM bundle names
Use normalized RPM matrix kernel versions in rolling snapshot archive
names. Keep vendor suffixes in package metadata and leave Ubuntu DKMS
independent of the runner kernel.
2026-08-25 14:24:22 +03:00
Gleb Chesnokov f5d133af6e .github/workflows: Drop redundant GCC build
Keep the standalone CI matrix focused on Clang. GCC is already
exercised by Ubuntu DEB and RPM package builds with WERROR enabled.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov 5f9d79a099 .github/workflows: Avoid duplicate branch builds
Run CI and package builds for pull requests and for pushes to master.
Avoid running both event types for each same-repository PR update.

Keep manual package workflow runs available.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov d29a7fe26e .github/workflows: Configure warnings-as-errors policy
Enable WERROR=y for CI and package builds so warnings in SCST code
are fatal.

Keep WERROR=n for regression and Coverity because these workflows
must tolerate failures outside strict SCST package gates.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov b8e386a6bc build: Add warnings-as-errors mode
Add a WERROR=y|n build setting that keeps the local default unchanged
and exports -Werror for user-space and kernel compilation. Honor the same
setting in direct regression kernel builds.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov fb47ab3ef1 .github/workflows: Publish master package snapshot
Publish a rolling prerelease after the complete master package
matrix succeeds. Validate and bundle every downloaded artifact before
replacing the previous master-rpm snapshot.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov 88476ff915 .github/workflows: Build package matrix
Build the six RPM targets resolved from ABT_KERNELS and portable
Ubuntu DKMS and user-space packages. Upload commit-specific GitHub Actions
artifacts for every target.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov 12c599b3c4 build: Add containerized RPM artifact target
Expose verified RPM artifact production through a repository Make
target. Use Docker only as the Rocky Linux and Oracle Linux toolchain,
keep the source worktree read-only and support the selected UEK package
layouts.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov be6734bf3d .github/workflows: Generate regression kernel matrix
Generate the existing 53-kernel GitHub regression subset from
ABT_KERNELS instead of duplicating exact versions in the workflow.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov 84fdf96a0a scripts: Generate CI kernel matrices
Keep exact kernel versions only in ABT_KERNELS. Resolve the bounded GitHub
regression and RPM subsets from stable selectors, and reject missing or
ambiguous matches.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov a493057d09 docs: Refine patch development workflow
Distinguish temporary low-risk instrumentation from reviewable patches.

Keep the complete lint gate mandatory and tighten task contract semantics.
2026-08-25 12:10:06 +03:00
Gleb Chesnokov aa5cc2dd70 docs: Fix obvious typos
Correct duplicated and misspelled words in user and developer
documentation. No code or output strings are changed.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 220fcc95ed scst_dlm: Consolidate log format strings
Merge adjacent literals that only wrapped log messages across source
lines and remove a duplicate blank line. Keep the segmented lockspace
dump command unchanged because its fragments document the pipeline.

The string values and control flow remain unchanged.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov fd76859375 scst_lib: Consolidate split string literals
Merge adjacent literals used to wrap diagnostic format strings. Adjust
the affected call formatting and add braces around the exposed else arm
so the changed lines follow kernel style.

The string values and control flow remain unchanged.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 7a700c1447 scst_lib: Remove redundant terminal returns
Remove no-op return statements at the end of void functions. Keep the
labeled terminal return in tm_dbg_task_mgmt(), where it is required as
the target statement of goto out.

This patch does not change any functionality.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 91591e4749 scripts: Ignore complex macro diagnostics
SCST uses macro fragments for sense tuples, initializer lists and other
contexts where enclosing the expansion in parentheses would change its
meaning. Treat COMPLEX_MACRO as a project-wide checkpatch exception.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 28b811135d scripts: Add ShellCheck lint target
Add a tracked runner that discovers Bash scripts under scripts/ and
checks them with external source resolution enabled. Expose it through
the top-level Makefile.

Run the same entry point from the patch lint workflow whenever a range
touches Bash lint inputs, and report its result explicitly.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov f788bfd0d6 scripts: Fix ShellCheck diagnostics
Quote scalar arguments and use arrays for command option lists so paths
and options retain their boundaries. Preserve intentional version-field
splitting with narrow documented suppressions.

Also handle GNU getopt output without losing quoted arguments and
remove warnings about masked statuses, unused values and ambiguous test
expressions.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 055865e734 docs: Remove obsolete Subversion references
The tracked SVN tag ledger and checkout instructions predate the move to
Git and no longer describe a supported workflow.

Remove the obsolete material, point Debian metadata at GitHub and keep
the retired Gentoo guide generic about its old source location.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 1a1a75d9ed scripts: Remove non-Git VCS support
Mercurial branches remain in source-listing and cleanup helpers after
Subversion support was retired. SCST development now uses Git.

Remove Mercurial detection and commands together with stale Subversion
wording. Preserve the existing no-VCS source-list fallback and all Git
behavior.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 0aa6689c3a scripts: Validate monitor intervals
Reject zero and nonnumeric sampling intervals before entering the
monitor loops, avoiding division errors and repeated failed sleep
calls.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 7057358960 scripts/test-persistent-reservation: Stop after failures
Abort the dependent reservation sequence when an sg_persist command
fails instead of continuing to change device state. Quote the device
argument so it is passed to every command unchanged.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 5cc6d87b7b scripts: Fix helper edge cases
Propagate patch and module-list failures, normalize the script
directory, and expand the actual Mercurial subrepository name when
matching paths. Keep the existing no-optional-patches behavior
unchanged.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov c93836ed2d scripts/generate-release-archive: Preserve file arguments
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.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 91517609cd scripts/generate-kernel-patch: Preserve split patches
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.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 114d44cd51 scripts/run-regression-tests: Fix failure handling
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.
2026-08-21 19:58:59 +03:00