]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
ip_set: Fix build on kernels without INIT_DEFERRABLE_WORK
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 5 Mar 2020 15:28:23 +0000 (17:28 +0200)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 9 Mar 2020 10:56:12 +0000 (11:56 +0100)
There was macro rename in kernel with commit 203b42f73174 ("workqueue:
make deferrable delayed_work initializer names consistent") that renames
INIT_DELAYED_WORK_DEFERRABLE() to INIT_DEFERRABLE_WORK().

Fixes: 33f08da28324 ("netfilter: ipset: Fix "INFO: rcu detected stall in hash_xxx" reports")
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
configure.ac
kernel/include/linux/netfilter/ipset/ip_set_compat.h.in

index a03401b96c5fe6c2c28fa30c2d16787144281510..c7077558d26aa05c8aeac37066ac97e04efecc7a 100644 (file)
@@ -207,6 +207,16 @@ if test "$BUILDKMOD" == "yes"
 then
 dnl Check kernel incompatibilities... Ugly like hell
 
+AC_MSG_CHECKING([kernel source for INIT_DEFERRABLE_WORK])
+if test -f $ksourcedir/include/linux/workqueue.h && \
+   $GREP -q 'INIT_DEFERRABLE_WORK' $ksourcedir/include/linux/workqueue.h; then
+       AC_MSG_RESULT(yes)
+       AC_SUBST(HAVE_INIT_DEFERRABLE_WORK, define)
+else
+       AC_MSG_RESULT(no)
+       AC_SUBST(HAVE_INIT_DEFERRABLE_WORK, undef)
+fi
+
 AC_MSG_CHECKING([kernel source for system_power_efficient_wq])
 if test -f $ksourcedir/include/linux/workqueue.h && \
    $GREP -q 'system_power_efficient_wq' $ksourcedir/include/linux/workqueue.h; then
index 0261b8dd3c19548489638943f9cb3efa251e6ebe..deed0580d874102cd6af264639d59b5a86f678a1 100644 (file)
@@ -5,6 +5,7 @@
  * xt_set.c, ip_set_core.c, ip_set_getport.c, pfxlen.c too.
  */
 
+#@HAVE_INIT_DEFERRABLE_WORK@ HAVE_INIT_DEFERRABLE_WORK
 #@HAVE_SYSTEM_POWER_EFFICIENT_WQ@ HAVE_SYSTEM_POWER_EFFICIENT_WQ
 #@HAVE_STRUCT_XT_ACTION_PARAM@ HAVE_STRUCT_XT_ACTION_PARAM
 #@HAVE_VZALLOC@ HAVE_VZALLOC
@@ -169,6 +170,10 @@ static inline void cond_resched_rcu(void)
 #error "NETFILTER_NETLINK must be enabled: select NFACCT/NFQUEUE/LOG over NFNETLINK"
 #endif
 
+#ifndef HAVE_INIT_DEFERRABLE_WORK
+#define INIT_DEFERRABLE_WORK INIT_DELAYED_WORK_DEFERRABLE
+#endif
+
 #ifndef HAVE_SYSTEM_POWER_EFFICIENT_EQ
 #define system_power_efficient_wq system_wq
 #endif