From 0642b05bc557fa333525b1b2fed5ac68281b0134 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 26 May 2025 16:17:46 +0300 Subject: [PATCH] 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. --- .github/workflows/run_regression_tests.yaml | 4 ++-- nightly/conf/nightly.conf | 2 ++ scst/include/backport.h | 4 +++- scst/src/dev_handlers/scst_vdisk.c | 4 +++- scst/src/scst_lib.c | 19 ++++++++++++------- scst_local/scst_local.c | 8 ++++++-- 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run_regression_tests.yaml b/.github/workflows/run_regression_tests.yaml index dd07c1c4d..6b310d088 100644 --- a/.github/workflows/run_regression_tests.yaml +++ b/.github/workflows/run_regression_tests.yaml @@ -4,11 +4,9 @@ on: push: branches: - 3.9.x - - master pull_request: branches: - 3.9.x - - master jobs: regression_tests: @@ -34,10 +32,12 @@ jobs: '4.9.337', '3.18.140', '3.10.108', + '5.14.0-570.12.1.el9_6^AlmaLinux^9.6', '5.14.0-503.16.1.el9_5^AlmaLinux^9.5', '5.14.0-427.42.1.el9_4^AlmaLinux^9.4', '5.14.0-362.24.2.el9_3^AlmaLinux^9.3', '5.14.0-284.30.1.el9_2^AlmaLinux^9.2', + '4.18.0-553.53.1.el8_10^AlmaLinux^8.10', '4.18.0-513.24.1.el8_9^AlmaLinux^8.9', '4.18.0-477.13.1.el8_8^AlmaLinux^8.8', '4.18.0-425.19.2.el8_7^AlmaLinux^8.7', diff --git a/nightly/conf/nightly.conf b/nightly/conf/nightly.conf index acceb08a7..1766cb668 100644 --- a/nightly/conf/nightly.conf +++ b/nightly/conf/nightly.conf @@ -67,12 +67,14 @@ ABT_KERNELS=" \ 3.12.74-nc \ 3.11.10-nc \ 3.10.108-nc \ +5.14.0-570.12.1.el9_6^AlmaLinux^9.6-nc \ 5.14.0-503.16.1.el9_5^AlmaLinux^9.5-nc \ 5.14.0-427.42.1.el9_4^AlmaLinux^9.4-nc \ 5.14.0-362.24.2.el9_3^AlmaLinux^9.3-nc \ 5.14.0-284.30.1.el9_2^AlmaLinux^9.2-nc \ 5.14.0-162.23.1.el9_1^AlmaLinux^9.1-nc \ 5.14.0-70.30.1.el9_0^AlmaLinux^9.0-nc \ +4.18.0-553.53.1.el8_10^AlmaLinux^8.10-nc \ 4.18.0-513.24.1.el8_9^AlmaLinux^8.9-nc \ 4.18.0-477.13.1.el8_8^AlmaLinux^8.8-nc \ 4.18.0-425.19.2.el8_7^AlmaLinux^8.7-nc \ diff --git a/scst/include/backport.h b/scst/include/backport.h index 803fcf6e4..70ed71935 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -677,7 +677,9 @@ static inline u32 int_sqrt64(u64 x) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6)) static inline long get_user_pages_backport(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 90c565eb0..8f4a3d744 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -968,7 +968,9 @@ static int vdisk_init_block_integrity(struct scst_vdisk_dev *virt_dev) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) bi_profile_name = bi->name; -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6)) bi_profile_name = bi->profile->name; #else bi_profile_name = blk_integrity_profile_name(bi); diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 50d60e339..1e67ab96c 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8398,8 +8398,9 @@ scst_free_bio(struct bio *bio) #endif } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) || \ -(defined(CONFIG_SUSE_KERNEL) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) || \ + (defined(CONFIG_SUSE_KERNEL) && \ + LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) static struct request *blk_make_request(struct request_queue *q, struct bio *bio, gfp_t gfp_mask) @@ -8447,7 +8448,9 @@ static struct request *blk_make_request(struct request_queue *q, static inline unsigned int queue_dma_pad_mask(const struct request_queue *q) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6)) return q->dma_pad_mask; #else return q->limits.dma_pad_mask; @@ -15358,14 +15361,16 @@ out_unlock: void scst_vfs_unlink_and_put(struct path *path) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) && \ - (!defined(CONFIG_SUSE_KERNEL) || \ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) && \ + (!defined(CONFIG_SUSE_KERNEL) || \ LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)) vfs_unlink(path->dentry->d_parent->d_inode, path->dentry); #elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) vfs_unlink(path->dentry->d_parent->d_inode, path->dentry, NULL); -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6)) vfs_unlink(&init_user_ns, path->dentry->d_parent->d_inode, path->dentry, NULL); #else diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index ae6ab0fee..6547b571a 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1023,7 +1023,9 @@ out: #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6)) static int scst_local_slave_alloc(struct scsi_device *sdev) { struct request_queue *q = sdev->request_queue; @@ -1365,7 +1367,9 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = { .name = SCST_LOCAL_NAME, .queuecommand = scst_local_queuecommand, .change_queue_depth = scst_local_change_queue_depth, -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6)) .slave_alloc = scst_local_slave_alloc, #else .dma_alignment = (4096 - 1),