Commit Graph
9405 Commits
Author SHA1 Message Date
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
Gleb Chesnokov 3056c73db8 scripts: Validate kernel downloads
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.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 82b5d44a0e docs: Make HTML checks reliable
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.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 5a56e2339b dpkg: Fix package metadata defaults
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.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 1a7c0c9b3c scst: Move build mode updates into recipes
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.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov f30bf2b208 Makefiles: Propagate recursive command failures
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.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov f0b22d068b www: Fix broken website resources
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.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 1faec3809a docs: Remove obsolete pre-3.10 kernel guidance
Drop Linux 2.6 build examples, an obsolete SRP initiator warning and
iSCSI daemon advice for a poll() bug fixed before the supported kernel
range.
2026-08-21 19:58:59 +03:00
Gleb Chesnokov 7a92e60868 scst: Remove pre-3.10 compatibility code
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.
2026-08-21 19:58:59 +03:00