diff --git a/scst/include/backport.h b/scst/include/backport.h index 52e38e693..0bc413b1d 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -964,7 +964,9 @@ static inline void lockdep_unregister_key(struct lock_class_key *key) * See also commit 5facae4f3549 ("locking/lockdep: Remove unused @nested * argument from lock_release()"). */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 3)) #undef rwlock_release #define rwlock_release(l, i) lock_release(l, 1, i) #undef mutex_release @@ -2006,7 +2008,9 @@ static inline struct ib_pd *ib_alloc_pd_backport(struct ib_device *device) /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) || \ - LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) + LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || \ + (defined(RHEL_RELEASE_CODE) && \ + RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(8, 3)) /* * See also patch "[SCSI] bidirectional command support" (commit ID * 6f9a35e2dafa). See also commit ae3d56d81507 ("scsi: remove bidirectional diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 61d659a77..fa8d1f580 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1011,8 +1011,10 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *scmd, #endif if (scsi_bidi_cmnd(scmd)) { -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 3)) /* Some of these symbols are only defined after 2.6.24 */ dir = SCST_DATA_BIDI; scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(scmd)); @@ -1155,6 +1157,7 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) { struct request_queue *q = sdev->request_queue; +#ifdef QUEUE_FLAG_BIDI #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) && \ !defined(CONFIG_SUSE_KERNEL) #if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6 @@ -1162,6 +1165,7 @@ static int scst_local_slave_alloc(struct scsi_device *sdev) #endif #elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) blk_queue_flag_set(QUEUE_FLAG_BIDI, q); +#endif #endif /*