This is the result of running the Linux kernel Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci against the SCST tree.
This patch doesn't change any functionality.
In clang version 21.1 and later the -Wimplicit-enum-enum-cast warning
option has been introduced. This warning is enabled by default and can
be used to catch .queuecommand() implementations that return another
value than 0 or one of the SCSI_MLQUEUE_* constants. Hence this patch
that changes the return type of the .queuecommand() implementations from
'int' into 'enum scsi_qc_status'. No functionality has been changed.
The lockless fast path for scst_cmd_set_sn() can cause commands to
lockup in state EXEC_CHECK_SN when there are multiple scst_tgts
accessing the same scst_device, for example two initiators
connected to the two ports of a dual-port QLogic FC HBA in target mode
both reading from the same shared disk. The multithreaded_init_done
value is too low-level for this; it does not take the higher-level
configuration into account.
- Remove the lockless fast path.
- Remove multithreaded_init_done, which enabled/disabled the lockless
fast path.
- Push the locking down into scst_cmd_set_sn(), which will now apply
regardless of set_sn_on_restart_cmd, which matters for mixed-driver
(e.g. iSCSI+qla2xxx) target-mode setups.
- Remove a bunch of comments explaining the rules for the lockless fast
path.
Fixes: https://github.com/SCST-project/scst/issues/333
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
The calculation of the upper limit for queues does not depend solely on
the number of online CPUs; for example, the isolcpus kernel
command-line option must also be considered.
To account for this, the block layer provides a helper function to
retrieve the maximum number of queues. Use it to set an appropriate
upper queue number limit.
-fstack-protector-strong is controlled by the in-tree
CONFIG_STACKPROTECTOR_STRONG config option. If the flag is set without
the config option, scst fails to build:
ERROR: modpost: "__stack_chk_fail" [scst/src/scst.ko] undefined!
-fstack-clash-protection is disabled in the kernel's Makefile due to an
incompatibility with randomize_kstack_offset.
Fixes: 86d3d4bb1d ("kbuild: Enable additional compiler warnings")
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
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.
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.
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.
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.
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.
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")
The workqueue maintainer wants to remove the create*_workqueue() macros
because these macros always set the WQ_MEM_RECLAIM flag and because these
only support literal workqueue names. Hence this patch that replaces the
create*_workqueue() invocations with the definition of this macro. The
WQ_MEM_RECLAIM flag has been retained because I think that flag is necessary
for workqueues created by storage drivers.
Support for the following driver core changes in the Linux kernel v6.11:
- d69d80484598 ("driver core: have match() callback in struct bus_type
take a const *")
Support for the following scsi layer changes in the Linux kernel v6.10:
- 5b7dfbeff92a ("scsi: core: Add a dma_alignment field to the host and
host template")
This patch fixes the installation process for Linux kernels where the
default value of INSTALL_MOD_DIR differs from `extra`.
For instance, it unbreaks `make rpm` against Fedora's kernels, where
INSTALL_MOD_DIR is set to `updates`.
1. Correct a typo, changing `make release` to `make 2release`.
2. Add information about package-related targets to the help section.
3. Remove `dev_handler` directory during the uninstall process.
4. Eliminate the non-existent `tgt` target from the PHONY targets.
5. Introduce SCST_MOD_DIR and SCST_DH_MOD_DIR as helper variables.
The previous series of patches introduced the use of a const pointer to
scsi_host_template. However, scsi_host_alloc() uses a non-const pointer
prior to kernel version 6.4, causing the build to throw the following
error:
passing argument 1 of ‘scsi_host_alloc’ discards ‘const’
qualifier from pointer target type
Hence, cast away the constness to resolve the error.
The previous commit removed support for building with clang. Restore support
for building with clang without breaking cross-compilation support.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9209 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since not all kernel header files are compatible with -Wextra, remove -Wextra.
To enable -Wextra, build SCST with W=1.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9054 d57e44dd-8a1f-0410-8b47-8ef2f437770f