From d05aed2445887fac5415697c3d76c282194c7fce Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 8 Aug 2020 15:24:18 +0000 Subject: [PATCH] scst: Fix the build against RHEL 8 debug kernels (merge r8886 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.4.x@9110 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 4 +++- scst/src/scst_lib.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index 831b77305..ba525e062 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -4867,7 +4867,9 @@ static inline struct scatterlist *sg_next_inline(struct scatterlist *sg) static inline void sg_clear(struct scatterlist *sg) { memset(sg, 0, sizeof(*sg)); -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) && defined(CONFIG_DEBUG_SG) +#if defined(CONFIG_DEBUG_SG) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) && \ + (!defined(RHEL_MAJOR) && RHEL_MAJOR -0 < 8) sg->sg_magic = SG_MAGIC; #endif } diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 3cb37dc8f..ccef1605e 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8549,7 +8549,8 @@ static void scsi_end_async(struct request *req, blk_status_t error) #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) lockdep_assert_held(req->q->queue_lock); -#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8) if (!req->q->mq_ops) lockdep_assert_held(req->q->queue_lock); #endif