From ca9d681fd041b11fe37cf520b5d53154b6224fda Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 18 Nov 2020 01:30:33 +0000 Subject: [PATCH] scst: Fix the kobj_ns_grab_current() and kobj_ns_drop() backports Reported-by: Gilbert Standen git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9182 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 06616614a..0fff88b04 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -839,12 +839,15 @@ enum kobj_ns_type { }; #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) /* * See also commit 5f256becd868 ("[NET]: Basic network namespace - * infrastructure.") # v2.6.24. a685e08987d1 ("Delay struct net freeing while - * there's a sysfs instance refering to it") # v3.0. + * infrastructure."; v2.6.24). a685e08987d1 ("Delay struct net freeing while + * there's a sysfs instance refering to it"; v3.0). See also commit + * 172856eac7cf ("kobject: Export kobj_ns_grab_current() and kobj_ns_drop()"; + * v4.16). */ static inline void *kobj_ns_grab_current(enum kobj_ns_type type) {