Hello community, here is the log from the commit of package drbd for openSUSE:Factory checked in at 2018-11-22 13:25:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/drbd (Old) and /work/SRC/openSUSE:Factory/.drbd.new.19453 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "drbd" Thu Nov 22 13:25:19 2018 rev:72 rq:650583 version:9.0.16+git.ab9777df Changes: -------- --- /work/SRC/openSUSE:Factory/drbd/drbd.changes 2018-11-13 17:08:27.386987319 +0100 +++ /work/SRC/openSUSE:Factory/.drbd.new.19453/drbd.changes 2018-11-22 13:25:27.670003999 +0100 @@ -1,0 +2,6 @@ +Wed Nov 21 07:47:51 UTC 2018 - [email protected] + +- bsc#1116820, kernel compatible issue of sle15sp1 +- Add patch compat_have_mempool_init.patch + +------------------------------------------------------------------- New: ---- compat_have_mempool_init.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ drbd.spec ++++++ --- /var/tmp/diff_new_pack.C7ChfU/_old 2018-11-22 13:25:29.018002592 +0100 +++ /var/tmp/diff_new_pack.C7ChfU/_new 2018-11-22 13:25:29.022002588 +0100 @@ -36,6 +36,7 @@ Source2: Module.supported Source3: drbd_git_revision Patch1: fix-resync-finished-with-syncs-have-bits-set.patch +Patch2: compat_have_mempool_init.patch BuildRequires: kernel-source BuildRequires: kernel-syms BuildRequires: libelf-devel @@ -69,6 +70,7 @@ %prep %setup -q -n drbd-%{version} %patch1 -p1 +%patch2 -p1 mkdir source cp -a drbd/. source/. || : @@ -89,6 +91,8 @@ cp %{_sourcedir}/Module.supported $flavor export DRBDSRC="$PWD/obj/$flavor" make -C %{kernel_source $flavor} modules M=$PWD/$flavor + #Check the compat result + cat $PWD/$flavor/compat.h done %install ++++++ compat_have_mempool_init.patch ++++++ diff -Naur drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/drbd_wrappers.h drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/drbd_wrappers.h --- drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/drbd_wrappers.h 2018-11-21 16:42:49.173926025 +0800 +++ drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/drbd_wrappers.h 2018-11-21 16:44:33.373769980 +0800 @@ -1348,8 +1348,11 @@ #endif #ifndef COMPAT_HAVE_BIOSET_INIT + +#ifndef COMPAT_HAVE_MEMPOOL_INIT #define mempool_free(V, P) mempool_free(V, *P) #define mempool_alloc(P, F) mempool_alloc(*P, F) +#endif #ifndef COMPAT_HAVE_BIO_CLONE_FAST # define bio_clone_fast(bio, gfp, bio_set) bio_clone(bio, gfp) @@ -1358,7 +1361,13 @@ #endif #define bio_alloc_bioset(GFP, n, P) bio_alloc_bioset(GFP, n, *P) + +#ifndef COMPAT_HAVE_MEMPOOL_INIT #define DRBD_MEMPOOL_T mempool_t * +#else +#define DRBD_MEMPOOL_T mempool_t +#endif + #define DRBD_BIO_SET bio_set * static inline void bioset_exit(struct bio_set **bs) { @@ -1367,6 +1376,8 @@ *bs = NULL; } } + +#ifndef COMPAT_HAVE_MEMPOOL_INIT static inline void mempool_exit(mempool_t **p) { if (*p) { @@ -1374,6 +1385,8 @@ *p = NULL; } } +#endif + #if defined(COMPAT_HAVE_BIOSET_NEED_BVECS) #define bioset_init(BS, S, FP, F) __bioset_init(BS, S, FP, F) #else @@ -1385,6 +1398,8 @@ *bs = bioset_create(size, front_pad, flags); return *bs == NULL ? -ENOMEM : 0; } + +#ifndef COMPAT_HAVE_MEMPOOL_INIT static inline int mempool_init_page_pool(mempool_t **pool, int min_nr, int order) { @@ -1397,6 +1412,8 @@ *pool = mempool_create_slab_pool(min_nr, mem_cache); return *pool == NULL ? -ENOMEM : 0; } +#endif + static inline bool bioset_initialized(struct bio_set **bs) { diff -Naur drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/tests/have_mempool_init.c drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/tests/have_mempool_init.c --- drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/tests/have_mempool_init.c 1970-01-01 08:00:00.000000000 +0800 +++ drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/tests/have_mempool_init.c 2018-11-21 16:43:42.429846044 +0800 @@ -0,0 +1,14 @@ +#include <linux/mempool.h> +/* +With linux v4.18 mempool_init get embedded +commit c1a67fefd0546a5552289c65fe31b1d60e64b643 +Author: Kent Overstreet <[email protected]> +Date: Mon May 4 16:52:20 2015 -0700 +*/ + +static int foo(void) +{ + struct mempool_s mempool_t; + + return mempool_init_page_pool(&mempool_t, 0, 0); +}
