diff --git a/scst/include/backport.h b/scst/include/backport.h index dfc6a0dae..a8850f665 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1863,11 +1863,16 @@ static inline struct kmem_cache *kmem_cache_create_usercopy(const char *name, /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0) +#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ + RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4 /* See also commit ba423fdaa589 ("net: add a new sockptr_t type") # v5.9 */ static inline void __user *KERNEL_SOCKPTR(void *p) { return (void __force __user *)p; } +#else +#define KERNEL_SOCKPTR(p) ((char __force __user *)p) +#endif #endif /* */ @@ -2031,7 +2036,9 @@ static inline void put_unaligned_be64(uint64_t i, void *p) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ + RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4) /* Only use get_unaligned_be24() if reading p - 1 is allowed. */ static inline uint32_t get_unaligned_be24(const uint8_t *const p) { @@ -2236,6 +2243,8 @@ fc_host_fpin_rcv(struct Scsi_Host *shost, u32 fpin_len, char *fpin_buf) * ELS requests"). */ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ + RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4) && \ !(defined(UEK_KABI_RENAME) && defined(FC_PORTSPEED_256GBIT)) #define ELS_RDP 0x18 #endif diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 36fda650a..4522c8fb3 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -486,7 +486,9 @@ static int vdisk_blockio_flush(struct block_device *bdev, gfp_t gfp_mask, res = blkdev_issue_flush(bdev, NULL); #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) res = blkdev_issue_flush(bdev, gfp_mask, NULL, BLKDEV_IFL_WAIT); -#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ + RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4) res = blkdev_issue_flush(bdev, gfp_mask, NULL); #elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) res = blkdev_issue_flush(bdev, gfp_mask);