From 3fb16aa6245c7ffdb43b9b4479ade2b1f7048b75 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Tue, 9 Dec 2025 10:15:34 +0300 Subject: [PATCH] scst: Unbreak the RHEL 10.1 build Fixes: https://github.com/SCST-project/scst/issues/317 --- .github/workflows/run_regression_tests.yaml | 1 + nightly/conf/nightly.conf | 1 + qla2x00t-32gbit/qla_os.c | 16 ++++++++++++---- qla2x00t/qla_os.c | 20 +++++++++++++++----- scst/include/backport.h | 4 +++- scst/src/dev_handlers/scst_vdisk.c | 4 +++- scst_local/scst_local.c | 8 ++++++-- 7 files changed, 41 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml index c51b808f2..9579fc239 100644 --- a/.github/workflows/run_regression_tests.yaml +++ b/.github/workflows/run_regression_tests.yaml @@ -37,6 +37,7 @@ jobs: '4.9.337', '3.18.140', '3.10.108', + '6.12.0-124.13.1.el10_1^AlmaLinux^10.1', '6.12.0-55.34.1.el10_0^AlmaLinux^10.0', '5.14.0-611.5.1.el9_7^AlmaLinux^9.7', '5.14.0-570.46.1.el9_6^AlmaLinux^9.6', diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index ff7afa5c5..f7a3654bc 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -72,6 +72,7 @@ ABT_KERNELS=" \ 3.12.74-nc \ 3.11.10-nc \ 3.10.108-nc \ +6.12.0-124.13.1.el10_1^AlmaLinux^10.1-nc \ 6.12.0-55.34.1.el10_0^AlmaLinux^10.0-nc \ 5.14.0-611.5.1.el9_7^AlmaLinux^9.7-nc \ 5.14.0-570.46.1.el9_6^AlmaLinux^9.6-nc \ diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index ee87d0379..5334de2c1 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -1971,7 +1971,9 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) } static int -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) qla2xxx_slave_alloc(struct scsi_device *sdev) #else qla2xxx_sdev_init(struct scsi_device *sdev) @@ -1988,7 +1990,9 @@ qla2xxx_sdev_init(struct scsi_device *sdev) } static int -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) qla2xxx_slave_configure(struct scsi_device *sdev) #else qla2xxx_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) @@ -2013,7 +2017,9 @@ qla2xxx_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) } static void -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) qla2xxx_slave_destroy(struct scsi_device *sdev) #else qla2xxx_sdev_destroy(struct scsi_device *sdev) @@ -8239,7 +8245,9 @@ struct scsi_host_template qla2xxx_driver_template = { .eh_bus_reset_handler = qla2xxx_eh_bus_reset, .eh_host_reset_handler = qla2xxx_eh_host_reset, -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) .slave_configure = qla2xxx_slave_configure, .slave_alloc = qla2xxx_slave_alloc, .slave_destroy = qla2xxx_slave_destroy, diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index c06cd8ee6..200ca377a 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -243,7 +243,9 @@ MODULE_PARM_DESC(ql2xmdenable, /* * SCSI host template entry points */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) static int qla2xxx_slave_configure(struct scsi_device *sdev); static int qla2xxx_slave_alloc(struct scsi_device *sdev); static void qla2xxx_slave_destroy(struct scsi_device *sdev); @@ -283,7 +285,9 @@ struct scsi_host_template qla2xxx_driver_template = { .eh_bus_reset_handler = qla2xxx_eh_bus_reset, .eh_host_reset_handler = qla2xxx_eh_host_reset, -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) .slave_configure = qla2xxx_slave_configure, .slave_alloc = qla2xxx_slave_alloc, .slave_destroy = qla2xxx_slave_destroy, @@ -1400,7 +1404,9 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) } static int -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) qla2xxx_slave_alloc(struct scsi_device *sdev) #else qla2xxx_sdev_init(struct scsi_device *sdev) @@ -1417,7 +1423,9 @@ qla2xxx_sdev_init(struct scsi_device *sdev) } static int -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) qla2xxx_slave_configure(struct scsi_device *sdev) #else qla2xxx_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) @@ -1443,7 +1451,9 @@ qla2xxx_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) } static void -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) qla2xxx_slave_destroy(struct scsi_device *sdev) #else qla2xxx_sdev_destroy(struct scsi_device *sdev) diff --git a/scst/include/backport.h b/scst/include/backport.h index ba9b457f0..47f27afbf 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1041,7 +1041,9 @@ register_shrinker_backport(struct shrinker *shrinker, const char *fmt, ...) /* */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) #define SCST_NAMESPACE SCST #define SCST_QLA16_NAMESPACE QLA16GB #define SCST_QLA32_NAMESPACE QLA32GB diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index f55296322..fc5ab22f1 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -6540,7 +6540,9 @@ static int vdisk_create_bioset(struct scst_vdisk_dev *virt_dev) return res; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 15, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 15, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) /* * See also commit 105ca2a2c2ff ("block: split struct bio_integrity_payload") #v6.15. */ diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 93ffd61e8..897f3aa18 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1061,7 +1061,9 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) static int scst_local_slave_configure(struct scsi_device *sdev) #else static int scst_local_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) @@ -1387,7 +1389,9 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = { #else .dma_alignment = (4096 - 1), #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1)) .slave_configure = scst_local_slave_configure, #else .sdev_configure = scst_local_sdev_configure,