From 285a9425d5db4f48e736934586a251dff60b0512cfe958a7c0f769371b604018 Mon Sep 17 00:00:00 2001 From: nick wang Date: Fri, 3 Jan 2020 09:09:09 +0000 Subject: [PATCH 1/3] Accepting request 760597 from home:wanghaisu:branches:network:ha-clustering:Factory bsc#1159786, fix build issue of v5.5 OBS-URL: https://build.opensuse.org/request/show/760597 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=103 --- drbd.changes | 6 ++++++ drbd.spec | 7 +++++-- without_pr_warning.patch | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 without_pr_warning.patch diff --git a/drbd.changes b/drbd.changes index caa6830..f311664 100644 --- a/drbd.changes +++ b/drbd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jan 3 08:52:14 UTC 2020 - nick wang + +- bsc#1159786, fix build issue against v5.5 + add patch without_pr_warning.patch + ------------------------------------------------------------------- Thu Dec 26 07:55:03 UTC 2019 - nick wang diff --git a/drbd.spec b/drbd.spec index 90087d2..c7984a2 100644 --- a/drbd.spec +++ b/drbd.spec @@ -1,7 +1,7 @@ # # spec file for package drbd # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -37,7 +37,9 @@ Patch1: fix-resync-finished-with-syncs-have-bits-set.patch Patch2: rely-on-sb-handlers.patch Patch3: drbd-fix-zero-metadata-limit-by-page-size-misaligned.patch Patch4: drbd-update-resync-target-s-dagtag.patch -Patch5: suse-coccinelle.patch +#In 61ff72f401680(v5.5-rc2), pr_warning is removed +Patch5: without_pr_warning.patch +Patch6: suse-coccinelle.patch #https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py BuildRequires: coccinelle BuildRequires: kernel-source @@ -75,6 +77,7 @@ installed kernel. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 mkdir source cp -a drbd/. source/. || : diff --git a/without_pr_warning.patch b/without_pr_warning.patch new file mode 100644 index 0000000..80a7891 --- /dev/null +++ b/without_pr_warning.patch @@ -0,0 +1,39 @@ +diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci +--- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci 1970-01-01 08:00:00.000000000 +0800 ++++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci 2020-01-03 16:27:11.508386084 +0800 +@@ -0,0 +1,10 @@ ++@outdate_pr_waring@ ++identifier func; ++@@ ++func(...) { ++<... ++- pr_warning +++ pr_warn ++...> ++} ++ +diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_patch_names.c drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_patch_names.c +--- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_patch_names.c 2019-12-26 17:01:19.647961356 +0800 ++++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_patch_names.c 2020-01-03 16:31:30.077789676 +0800 +@@ -291,6 +291,9 @@ + patch(1, "allow_kernel_signal", true, false, + COMPAT_HAVE_ALLOW_KERNEL_SIGNAL, "present"); + ++ patch(1, "suse_pr_warning", true, false, ++ COMPAT_WITH_PR_WARNING, "present"); ++ + /* #define BLKDEV_ISSUE_ZEROOUT_EXPORTED */ + /* #define BLKDEV_ZERO_NOUNMAP */ + +diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/tests/with_pr_warning.c drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/tests/with_pr_warning.c +--- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/tests/with_pr_warning.c 1970-01-01 08:00:00.000000000 +0800 ++++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/tests/with_pr_warning.c 2019-12-26 17:52:57.761698224 +0800 +@@ -0,0 +1,8 @@ ++#include ++ ++/* pr_waring is dropped since 61ff72f401680 */ ++ ++void foo(void) ++{ ++ pr_warning("pr_warning replaced by pr_warn since 61ff72f401680!"); ++} From 789c220c0e6bfd6f53222016be0f61fb8ab67dbd28787d521f1a7d867b102635 Mon Sep 17 00:00:00 2001 From: nick wang Date: Mon, 6 Jan 2020 07:05:08 +0000 Subject: [PATCH 2/3] Accepting request 761065 from home:wanghaisu:branches:network:ha-clustering:Factory Update the without_pr_warning.patch patch OBS-URL: https://build.opensuse.org/request/show/761065 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=104 --- without_pr_warning.patch | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/without_pr_warning.patch b/without_pr_warning.patch index 80a7891..deb64d5 100644 --- a/without_pr_warning.patch +++ b/without_pr_warning.patch @@ -1,20 +1,21 @@ diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci --- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci 1970-01-01 08:00:00.000000000 +0800 -+++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci 2020-01-03 16:27:11.508386084 +0800 -@@ -0,0 +1,10 @@ ++++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/cocci/suse_pr_warning__no_present.cocci 2020-01-06 14:52:30.740564872 +0800 +@@ -0,0 +1,11 @@ +@outdate_pr_waring@ +identifier func; ++expression list EL; +@@ +func(...) { +<... -+- pr_warning -++ pr_warn ++- pr_warning(EL); +++ pr_warn(EL); +...> +} + diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_patch_names.c drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_patch_names.c ---- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_patch_names.c 2019-12-26 17:01:19.647961356 +0800 -+++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_patch_names.c 2020-01-03 16:31:30.077789676 +0800 +--- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_patch_names.c 2020-01-06 14:50:00.827751099 +0800 ++++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_patch_names.c 2020-01-06 14:50:41.135969904 +0800 @@ -291,6 +291,9 @@ patch(1, "allow_kernel_signal", true, false, COMPAT_HAVE_ALLOW_KERNEL_SIGNAL, "present"); @@ -27,7 +28,7 @@ diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_patch_nam diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/tests/with_pr_warning.c drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/tests/with_pr_warning.c --- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/tests/with_pr_warning.c 1970-01-01 08:00:00.000000000 +0800 -+++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/tests/with_pr_warning.c 2019-12-26 17:52:57.761698224 +0800 ++++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/tests/with_pr_warning.c 2020-01-06 14:50:41.135969904 +0800 @@ -0,0 +1,8 @@ +#include + From 4fdf38b6cdf322c1616ff723de64cee255aeebad6eb4b0829502ebd6196242ff Mon Sep 17 00:00:00 2001 From: nick wang Date: Thu, 9 Jan 2020 06:05:38 +0000 Subject: [PATCH 3/3] Accepting request 762057 from home:wanghaisu:branches:network:ha-clustering:Factory Update suse-coccinelle.patch OBS-URL: https://build.opensuse.org/request/show/762057 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=105 --- drbd.spec | 4 +++- suse-coccinelle.patch | 22 +++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/drbd.spec b/drbd.spec index c7984a2..3845fd9 100644 --- a/drbd.spec +++ b/drbd.spec @@ -100,9 +100,11 @@ for flavor in %{flavors_to_build}; do cp -r source $flavor cp %{_sourcedir}/Module.supported $flavor export DRBDSRC="$PWD/obj/$flavor" + # bsc#1160194, check the coccicheck work. + #make coccicheck make %{?_smp_mflags} -C %{kernel_source $flavor} modules M=$PWD/$flavor SPAAS=${SPAAS} - #Check the compat result + # Check the compat result cat $PWD/$flavor/compat.h done diff --git a/suse-coccinelle.patch b/suse-coccinelle.patch index 6c88918..5e07dc2 100644 --- a/suse-coccinelle.patch +++ b/suse-coccinelle.patch @@ -1,6 +1,6 @@ -diff -Naur drbd-9.0.20~0rc3+git.9c642cce.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh drbd-9.0.20~0rc3+git.9c642cce/drbd/drbd-kernel-compat/gen_compat_patch.sh ---- drbd-9.0.20~0rc3+git.9c642cce.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh 2019-10-09 15:10:24.932509799 +0800 -+++ drbd-9.0.20~0rc3+git.9c642cce/drbd/drbd-kernel-compat/gen_compat_patch.sh 2019-10-10 17:51:46.280918975 +0800 +diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_compat_patch.sh +--- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh 2020-01-09 13:38:00.998984586 +0800 ++++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_compat_patch.sh 2020-01-09 13:38:10.407036976 +0800 @@ -41,6 +41,15 @@ < drbd-kernel-compat/cocci/debugfs_compat_template.cocci.in \ >> $incdir/.compat.cocci; @@ -42,3 +42,19 @@ diff -Naur drbd-9.0.20~0rc3+git.9c642cce.orig/drbd/drbd-kernel-compat/gen_compat if [ -e $incdir/.compat.patch ]; then cat $incdir/.compat.patch >> $compat_patch.tmp; fi; +diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/Makefile drbd-9.0.20~1+git.7dce3c8b/Makefile +--- drbd-9.0.20~1+git.7dce3c8b.orig/Makefile 2020-01-09 13:38:00.994984563 +0800 ++++ drbd-9.0.20~1+git.7dce3c8b/Makefile 2020-01-09 13:41:50.512262670 +0800 +@@ -310,9 +310,11 @@ + endif + + coccicheck: coccinelle/*.cocci ++ $(eval coccilibpath := $(shell rpm -ql coccinelle|grep standard.h|xargs dirname)) + @for file in $^ ; do \ + echo " COCCICHECK $$(basename $${file} .cocci)"; \ +- spatch --very-quiet drbd/drbd_*.c -D $(MODE) --sp-file $${file}; \ ++ spatch drbd/drbd_*.c --macro-file-builtins $(coccilibpath)/standard.h \ ++ --iso-file $(coccilibpath)/standard.iso -D $(MODE) --sp-file $${file}; \ + done + + Makefile: ;