Commit Graph

9191 Commits

Author SHA1 Message Date
Gleb Chesnokov
314659ed7c scstadmin: Normalize SCST version parsing in SCST.pm
scstadmin's version check assumed scstVersion() returns a bare "X.Y.Z".
After changing the sysfs attribute it may return strings like
"SCST version: 3.10.0-pre", which triggered a numeric warning and a
false failure:

  Argument "SCST version: 3" isn't numeric in numeric gt (...)

Parse the version number from the raw string and ignore any
prefix/suffix. If no version can be parsed, keep the existing
failure path.

Fixes: https://github.com/SCST-project/scst/issues/296
2025-08-18 11:45:57 +03:00
Gleb Chesnokov
d0b970fad0 qla2x00t-32gbit: Fix DMA mapping test in qla24xx_get_port_database()
dma_map_XXX() functions return as error values DMA_MAPPING_ERROR which is
often ~0.  The error value should be tested with dma_mapping_error() like
it was done in qla26xx_dport_diagnostics().

Fixes: 818c7f87a177 ("scsi: qla2xxx: Add changes in preparation for vendor extended FDMI/RDP")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://lore.kernel.org/r/20250617161115.39888-2-fourier.thomas@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit c3b214719a87 upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
06f8d870a3 qla2x00t-32gbit: Remove duplicate struct crb_addr_pair
In preparation for making the kmalloc family of allocators type aware, we
need to make sure that the returned type from the allocation matches the
type of the variable being assigned. (Before, the allocator would always
return "void *", which can be implicitly cast to any pointer type.)

The assigned type is "struct crb_addr_pair *" and the returned type will
be a _different_ "struct crb_addr_pair *", causing a warning. This really
stumped me for a bit. :) Drop the redundant declaration.

Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20250426061951.work.272-kees@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 386e014202f8 upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
5e3c7eaf27 qla2x00t-32gbit: Remove unused module parameters
ql2xetsenable last use was removed in 2020 by commit 37efd51f75f3 ("scsi:
qla2xxx: Use FC generic update firmware options routine for ISP27xx")

ql2xiidmaenable last use was removed in 2017 by commit 726b85487067
("qla2xxx: Add framework for async fabric discovery")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-9-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 3a37ab0827fd upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
61d96b8b93 qla2x00t-32gbit: Remove unused qla2x00_gpsc()
qla2x00_gpsc() was added in 2017 as part of commit 726b85487067
("qla2xxx: Add framework for async fabric discovery") but has remained
unused.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-8-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 45838d3db750 upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
07f82d9505 qla2x00t-32gbit: Remove unused ql_log_qp
ql_log_qp() was added in 2017 as part of commit 22d84726e3b8 ("scsi:
qla2xxx: Add debug logging routine for qpair") but has remained unused.

Remove it. (That patch also added ql_dbg_qp but that is still used so is
left in).

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-7-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 33f44a50ca61 upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
4db857c081 qla2x00t-32gbit: Remove unused qla82xx_wait_for_state_change()
qla82xx_wait_for_state_change() was added in 2010 as part of commit
579d12b58abb ("[SCSI] qla2xxx: Added support for quiescence mode for
ISP82xx.")  but has remained unused.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-6-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 2a2f3168c510 upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
42bb0fb1de qla2x00t-32gbit: Remove unused qla82xx_pci_region_offset()
qla82xx_pci_region_offset() has been unused since the last use was
removed by 2010's commit 3711333dfbee ("[SCSI] qla2xxx: Updates for
ISP82xx.")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-5-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 89981b47f6fc upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
3b945f84be qla2x00t-32gbit: Remove unused qlt_83xx_iospace_config()
qlt_83xx_iospace_config() has been unused since the last use was removed
by 2017's commit f54f2cb540b5 ("scsi: qla2xxx: Cleaned up queue
configuration code.")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-4-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 91453ebecccc upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
0d2807eff3 qla2x00t-32gbit: Remove unused qlt_fc_port_deleted()
qlt_fc_port_deleted() has been unused since the last use was removed by
2017's commit 726b85487067 ("qla2xxx: Add framework for async fabric
discovery")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-3-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit cbb2a2ef5801 upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
4bad58a3d3 qla2x00t-32gbit: Remove unused qlt_free_qfull_cmds()
qlt_free_qfull_cmds() was added in 2014 as part of commit 33e799775593
("qla2xxx: Add support for QFull throttling and Term Exchange retry") but
has remained unused.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250415002803.135909-2-linux@treblig.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit ae7a08bee82b upstream ]
2025-08-05 18:15:49 +03:00
Gleb Chesnokov
1186ac25c5 nightly build: Update kernel versions
Another kernel versions update
2025-08-05 17:41:32 +03:00
Gleb Chesnokov
2631557383 scst.spec.in: Replace custom Requires line with package names
The scst.spec.in file used a custom Requires line that dynamically resolved
the full paths of the find and rm commands using shell substitution with
'which'. This method is non-standard and can lead to issues in constrained
build environments.

This patch replaces the custom Requires line with explicit package names:
'findutils' for find and 'coreutils' for rm. This improves compatibility
and aligns with best practices for declaring dependencies in spec files.
2025-08-05 16:37:31 +03:00
Gleb Chesnokov
974b31fdcb scst: Port to Linux kernel v6.16
Support for the following timer changes in the Linux kernel v6.16:

- 41cb08555c41 ("treewide, timers: Rename from_timer() to timer_container_of()")
2025-08-05 16:37:31 +03:00
Gleb Chesnokov
c6d16dd86e qla2x00t, qla2x00t-32gbit: Constify 'struct bin_attribute'
The sysfs core now allows instances of 'struct bin_attribute' to be moved
into read-only memory. Make use of that to protect them against accidental
or malicious modifications.
2025-08-05 16:37:31 +03:00
Gleb Chesnokov
f85736549a iscsi-scst: Remove access to page->index
There is no need to print out page->index as part of the debug message.
2025-08-05 16:37:31 +03:00
Christoph Böhmwalder
3aad61d2fd iscsi-scst: use /run instead of /var/run
When attempting to manage iscsi-scstd using a systemd service file,
systemd warns:

PIDFile= references a path below legacy directory /var/run/, [...]

Change the pidfile path to be under /run instead.

/run has been in use as a replacement for /var/run for many years now
(the original Debian proposal is from 2011). Most distributions symlink
/var/run to /run, which means that this change should not have any
adverse side effects for the vast majority of users.
2025-06-26 15:11:58 +03:00
Gleb Chesnokov
17eb80e049 nightly build: Add RHEL 10 kernel support
Add AlmaLinux 10.0 kernel to nightly build configs and update helper
scripts to handle AlmaLinux 10.0 package sources.
2025-06-06 12:31:21 +03:00
Gleb Chesnokov
02167c4028 scst.h: Fix RHEL 9 build
Fixes: https://github.com/SCST-project/scst/issues/294
2025-06-06 12:31:21 +03:00
Gleb Chesnokov
15ebdec403 nightly build: Add UEK 8 kernel support
Add Oracle Linux UEK 8 kernel to nightly build configs and update helper
scripts to handle UEK 8 package sources.
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
44bd290fea scst: Add RHEL 8.10 and 9.6 kernel support
Add compatibility for RHEL 8.10 and RHEL 9.6 kernels. Update nightly build
and regression test configs, and adjust version checks in the codebase
to handle changes in these new RHEL kernel releases.
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
ac41d325f3 scst: Fix backport for stable, RHEL, and UEK kernels
Update backport logic to support recent stable, RHEL, and UEK kernel
versions. Adjust version checks and compatibility for sysfs_emit,
timer_delete, and related helpers.

Fixes: 0e8fdad5e4 ("scst: Use sysfs_emit/sysfs_emit_at instead of scnprintf()")
Fixes: d21b6f1457 ("scst: Port to Linux kernel v6.15")
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
15695fedce nightly build: Update kernel versions
Another kernel versions update
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
fdbb34c77e .github/workflows: Improve regression test failure detection in GitHub Actions
Update the run_regression_tests workflow to fail if "Compiling the patched
kernel" is missing or if any non-zero error count ("N errors") or "FAILED"
is detected after the marker.

The previous check missed multi-digit error counts and did not handle
a missing marker, which could result in undetected failures.
2025-05-26 17:37:09 +03:00
Gleb Chesnokov
707554a310 scst: Revert semantic kernel version change
Partially revert the earlier commit which limited SCST_KVER to a semantic
version only. Restore usage of the full kernel version string for improved
clarity in build metadata.

Fixes: ac1e7f82b7 ("scst: Fix SCST_KVER to use semantic version only")
2025-05-21 11:34:29 +03:00
Gleb Chesnokov
977904d33a scst: Use separate sysfs_emit_at() for emitting SCST_SYSFS_KEY_MARK
Replace combined sysfs_emit() calls with separate sysfs_emit() and
sysfs_emit_at() invocations when emitting SCST_SYSFS_KEY_MARK in sysfs
attribute show handlers.

This improves code clarity and consistency, explicitly handling the
conditional addition of SCST_SYSFS_KEY_MARK.

This patch does not change any functionality.
2025-05-19 20:46:54 +03:00
Gleb Chesnokov
0e8fdad5e4 scst: Use sysfs_emit/sysfs_emit_at instead of scnprintf()
Replace scnprintf() with sysfs_emit() and sysfs_emit_at() in sysfs show handlers.

These helper functions are specifically designed for sysfs output, providing safer
handling of buffer lengths and consistency across kernel sysfs interfaces.

This patch does not change any functionality.
2025-05-19 20:46:54 +03:00
Gleb Chesnokov
989802f48d scst: Replace snprintf() with scnprintf()
Replace snprintf() with scnprintf() in two places:

- code paths that build up a buffer incrementally
- sysfs attribute “show” handlers

scnprintf() guarantees its return value is the number of bytes actually
written (never exceeding the buffer), preventing potential overruns.

This patch does not change any functionality.
2025-05-19 20:46:54 +03:00
Gleb Chesnokov
7cdf85e663 scst_debug: Fix multiple checkpatch warnings
This patch does not change any functionality.
2025-05-19 20:46:54 +03:00
Gleb Chesnokov
ac1e7f82b7 scst: Fix SCST_KVER to use semantic version only
Previously, SCST_KVER included the full kernel release string. This patch
limits it to the semantic version (e.g. "6.9.0") for cleaner and more
consistent output in dmesg, sysfs, and modinfo.

Fixes: 6782003bfc ("scst: Extend build metadata passed to the SCST")
2025-05-16 17:33:33 +03:00
Gleb Chesnokov
6782003bfc scst: Extend build metadata passed to the SCST
Previously, only the revision string was passed from the build system
into the SCST kernel module. This patch extends that by passing additional
build metadata: kernel version, build date, Git commit hash, build number,
and architecture type.

These values are now consistently exposed in the kernel log, sysfs,
and via modinfo, providing a unified and reliable way to identify the
exact build in use.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
9cbca53830 scst: Replace sprintf() with scnprintf() in sysfs callbacks
Replace all uses of sprintf() with scnprintf() in sysfs attribute
callbacks to eliminate the risk of buffer overflows.

This patch does not change any functionality.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
4ce8735a92 scst_sysfs: Fix multiple checkpatch warnings
This patch does not change any functionality.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
e81277e8dc scst_const.h, scst_priv.h: Fix multiple checkpatch warnings
This patch does not change any functionality.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
949f5ef99c scst_main: Fix multiple checkpatch warnings
This patch does not change any functionality.
2025-05-16 16:37:43 +03:00
Gleb Chesnokov
a410829b26 scst_vdisk: Port to Linux kernel v6.15
Support for the following block layer changes in the Linux kernel v6.15:

- 105ca2a2c2ff ("block: split struct bio_integrity_payload")
2025-05-14 18:36:46 +03:00
Gleb Chesnokov
163eb9dcc1 scst: Port to Linux kernel v6.15
Support for the following scsi layer changes in the Linux kernel v6.15:

- 0ea163a18b17 ("scsi: usb: Rename the RESERVE and RELEASE constants")
2025-05-14 18:36:46 +03:00
Gleb Chesnokov
d21b6f1457 scst: Port to Linux kernel v6.15
Support for the following changes in the Linux kernel v6.15:

- 8fa7292fee5c ("treewide: Switch/rename to timer_delete[_sync]()")
2025-05-14 18:36:46 +03:00
Gleb Chesnokov
cc1e66a0e1 qla2x00t-32gbit: Mark device strings as nonstring
In preparation for memtostr*() checking that its source is marked as
nonstring, annotate the device strings accordingly.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> # SCSI
Signed-off-by: Kees Cook <kees@kernel.org>
[ commit 88a157a3204d upstream ]
2025-05-14 13:49:18 +03:00
Gleb Chesnokov
b9f56d6d16 qla2x00t-32gbit: Fix typos in a comment
Fix typos in a comment.

hapens -> happens
recommeds -> recommends

Signed-off-by: Yuichiro Tsuji <yuichtsu@amazon.com>
Link: https://lore.kernel.org/r/20250224075907.2505-1-yuichtsu@amazon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 0107fb8686b2 upstream ]
2025-05-14 13:49:18 +03:00
Gleb Chesnokov
d8db7deb2b Makefile: Actualise help target
Sync the `help` target with the actual Makefile rules:

- Include missing targets (tags, cov-build, docs, scstadm, scstadm-rpm)
- Reorder and align target groups
- Update `.PHONY` list
2025-04-21 14:22:43 +03:00
Gleb Chesnokov
c934aee1a8 Makefile, specs: Honour %{_sbindir} for helper tools
Fedora 42 maps %{_sbindir} to /usr/bin. Export SBINDIR=%{_sbindir} in
the spec files and let the iscsi-scst/scstadmin Makefiles honour that
variable.

Fixes "File not found: .../iscsi-scst-adm" on unified-/usr systems while
keeping older distros unchanged.
2025-04-18 18:54:20 +03:00
Gleb Chesnokov
ef37ad252c scst_lib: Mark devkey string as nonstring
Fix the following GCC 15 warnings:

    initializer-string for array of ‘unsigned char’ truncates NUL
    terminator but destination lacks ‘nonstring’ attribute
    (17 chars into 16 available)

This patch doesn't change any functionality.
2025-04-18 18:54:20 +03:00
Gleb Chesnokov
f32f464190 iscsi-scstd: Fix redefinition of bool when building with GCC 15
GCC 15 (C23) now reserves bool/true/false, so the local typedef in
iscsid.d breaks the build:

    error: cannot use keyword 'false' as enumeration constant
    error: expected ';', identifier or '(' before 'bool'

Include <stdbool.h> and drop the typedef.
2025-04-18 18:54:20 +03:00
Gleb Chesnokov
86d3d4bb1d kbuild: Enable additional compiler warnings
Add additional compiler flags to improve code compliance.
2025-03-25 18:57:32 +03:00
Gleb Chesnokov
12a00ffc89 nightly build: Update kernel versions
Another kernel versions update
2025-03-25 18:57:32 +03:00
Gleb Chesnokov
d09f360b93 scripts: Fix shellcheck warnings for checkpatch scripts
- Switching from 'set -e' to 'set -euo pipefail' for better error handling.
- Quoting all variable expansions to prevent word splitting and globbing.
- Replacing legacy unquoted $(...) and $@ with quoted forms.
- Using array-safe idioms where necessary (e.g., "${src_files[@]}").

This patch doesn't change any functionality.
2025-03-25 18:57:32 +03:00
Gleb Chesnokov
2e92bd0bb3 qla2x00t-32gbit: Move FCE Trace buffer allocation to user control
Currently FCE Tracing is enabled to log additional ELS events. Instead,
user will enable or disable this feature through debugfs.

Modify existing DFS knob to allow user to enable or disable this
feature.

echo [1 | 0] > /sys/kernel/debug/qla2xxx/qla2xxx_??/fce
cat  /sys/kernel/debug/qla2xxx/qla2xxx_??/fce

Cc: stable@vger.kernel.org
Fixes: df613b96077c ("[SCSI] qla2xxx: Add Fibre Channel Event (FCE) tracing support.")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20241115130313.46826-4-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 841df27d619e upstream ]
2025-03-25 17:19:08 +03:00
Gleb Chesnokov
a2c1c2d8b2 qla2x00t, qla2x00t-32gbit, scst_local: Port to Linux kernel v6.14
Support for the following scsi layer changes in the Linux kernel v6.14:

- ed638918f4df ("scsi: Rename .slave_alloc() and .slave_destroy()")
- 49515b7fe50c ("scsi: Convert SCSI drivers to .sdev_configure()")
- c9a71ca13f71 ("scsi: Constify struct pci_device_id")
- bd326a5ad639 ("scsi: replace blk_mq_pci_map_queues with blk_mq_map_hw_queues")
2025-03-25 16:53:57 +03:00
Gleb Chesnokov
1f40850809 scst_lib: Port to Linux kernel v6.14
Support for the following block layer changes in the Linux kernel v6.14:

- 6aeb4f836480 ("block: remove bio_add_pc_page")
2025-03-25 16:53:57 +03:00