Merge "rebase drbd drver patch to 8.4.11-1 version"
This commit is contained in:
commit
d423779dc2
@ -1,4 +1,4 @@
|
|||||||
COPY_LIST="$FILES_BASE/* \
|
COPY_LIST="$FILES_BASE/* \
|
||||||
$DISTRO/patches/* \
|
$DISTRO/patches/* \
|
||||||
$CGCS_BASE/downloads/drbd-8.4.7-1.tar.gz"
|
$CGCS_BASE/downloads/drbd-8.4.11-1.tar.gz"
|
||||||
TIS_PATCH_VER=4
|
TIS_PATCH_VER=0
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
Name: drbd-kernel%{?bt_ext}
|
Name: drbd-kernel%{?bt_ext}
|
||||||
Summary: Kernel driver for DRBD
|
Summary: Kernel driver for DRBD
|
||||||
Version: 8.4.7
|
Version: 8.4.11
|
||||||
%define upstream_release 1
|
%define upstream_release 1
|
||||||
Release: %{upstream_release}%{?_tis_dist}.%{tis_patch_ver}
|
Release: %{upstream_release}%{?_tis_dist}.%{tis_patch_ver}
|
||||||
%global tarball_version %(echo "%{version}-%{?upstream_release}" | sed -e "s,%{?dist}$,,")
|
%global tarball_version %(echo "%{version}-%{?upstream_release}" | sed -e "s,%{?dist}$,,")
|
||||||
@ -25,7 +25,6 @@ Source0: http://oss.linbit.com/drbd/drbd-%{tarball_version}.tar.gz
|
|||||||
|
|
||||||
# WRS
|
# WRS
|
||||||
Patch0001: 0001-remove_bind_before_connect_error.patch
|
Patch0001: 0001-remove_bind_before_connect_error.patch
|
||||||
Patch0002: compat-Statically-initialize-families.patch
|
|
||||||
|
|
||||||
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
|
%define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//')
|
||||||
|
|
||||||
@ -86,7 +85,6 @@ echo "Done."
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n drbd-%{tarball_version}
|
%setup -q -n drbd-%{tarball_version}
|
||||||
%patch0001 -p1
|
%patch0001 -p1
|
||||||
%patch0002 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
rm -rf obj
|
rm -rf obj
|
||||||
|
@ -2,7 +2,7 @@ Index: drbd-8.4.7-1/drbd/drbd_receiver.c
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- drbd-8.4.7-1.orig/drbd/drbd_receiver.c
|
--- drbd-8.4.7-1.orig/drbd/drbd_receiver.c
|
||||||
+++ drbd-8.4.7-1/drbd/drbd_receiver.c
|
+++ drbd-8.4.7-1/drbd/drbd_receiver.c
|
||||||
@@ -718,6 +718,7 @@ out:
|
@@ -719,6 +719,7 @@ out:
|
||||||
/* peer not (yet) available, network problem */
|
/* peer not (yet) available, network problem */
|
||||||
case ECONNREFUSED: case ENETUNREACH:
|
case ECONNREFUSED: case ENETUNREACH:
|
||||||
case EHOSTDOWN: case EHOSTUNREACH:
|
case EHOSTDOWN: case EHOSTUNREACH:
|
||||||
|
@ -1,171 +0,0 @@
|
|||||||
From 7510d78909774e33b64ada4055bea65881350763 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <7510d78909774e33b64ada4055bea65881350763.1528136610.git.Jim.Somerville@windriver.com>
|
|
||||||
From: Nick Wang <nwang@suse.com>
|
|
||||||
Date: Mon, 13 Mar 2017 15:23:29 +0800
|
|
||||||
Subject: [PATCH 1/1] compat: Statically initialize families
|
|
||||||
|
|
||||||
In a07ea4d9, genetlink no longer use static family id.
|
|
||||||
GENL_ID_GENERATE is removed.
|
|
||||||
In 489111e5, statically initialize the families and remove
|
|
||||||
the inline functions.
|
|
||||||
|
|
||||||
Thanks to Nick Wang <nwang@suse.com> for preparing a first draft.
|
|
||||||
Unfortunately this version actually broke netlink on v4.10. Probably
|
|
||||||
only compile-tested, but never "drbdadm up" tested.
|
|
||||||
|
|
||||||
Signed-off-by: Nick Wang <nwang@suse.com>
|
|
||||||
[add missing pieces introduced in 489111e5]
|
|
||||||
Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
|
|
||||||
[Simplified :-) and backported to drbd 8.4]
|
|
||||||
Signed-off-by: Lars Ellenberg <lars@linbit.com>
|
|
||||||
|
|
||||||
Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
|
|
||||||
---
|
|
||||||
.../tests/have_genl_family_in_genlmsg_multicast.c | 9 ++++++
|
|
||||||
drbd/compat/tests/have_genl_id_generate.c | 6 ++++
|
|
||||||
.../tests/have_genl_register_family_with_ops.c | 9 ++++++
|
|
||||||
.../tests/have_genl_register_family_with_ops3.c | 9 ++++++
|
|
||||||
...gic_func-genl_register_family_with_ops_groups.h | 4 +++
|
|
||||||
drbd/linux/genl_magic_func.h | 34 +++++++++++++++-------
|
|
||||||
6 files changed, 61 insertions(+), 10 deletions(-)
|
|
||||||
create mode 100644 drbd/compat/tests/have_genl_family_in_genlmsg_multicast.c
|
|
||||||
create mode 100644 drbd/compat/tests/have_genl_id_generate.c
|
|
||||||
create mode 100644 drbd/compat/tests/have_genl_register_family_with_ops.c
|
|
||||||
create mode 100644 drbd/compat/tests/have_genl_register_family_with_ops3.c
|
|
||||||
|
|
||||||
diff --git a/drbd/compat/tests/have_genl_family_in_genlmsg_multicast.c b/drbd/compat/tests/have_genl_family_in_genlmsg_multicast.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..6d44faa
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/drbd/compat/tests/have_genl_family_in_genlmsg_multicast.c
|
|
||||||
@@ -0,0 +1,9 @@
|
|
||||||
+#include <net/genetlink.h>
|
|
||||||
+
|
|
||||||
+void test(void)
|
|
||||||
+{
|
|
||||||
+ struct genl_family family = { };
|
|
||||||
+ struct sk_buff *skb = NULL;
|
|
||||||
+
|
|
||||||
+ genlmsg_multicast(&family, skb, 0, 0, GFP_KERNEL);
|
|
||||||
+}
|
|
||||||
diff --git a/drbd/compat/tests/have_genl_id_generate.c b/drbd/compat/tests/have_genl_id_generate.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..4ef0e8e
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/drbd/compat/tests/have_genl_id_generate.c
|
|
||||||
@@ -0,0 +1,6 @@
|
|
||||||
+#include <linux/genetlink.h>
|
|
||||||
+
|
|
||||||
+void test(void)
|
|
||||||
+{
|
|
||||||
+ int i = GENL_ID_GENERATE;
|
|
||||||
+}
|
|
||||||
diff --git a/drbd/compat/tests/have_genl_register_family_with_ops.c b/drbd/compat/tests/have_genl_register_family_with_ops.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..27123db
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/drbd/compat/tests/have_genl_register_family_with_ops.c
|
|
||||||
@@ -0,0 +1,9 @@
|
|
||||||
+#include <net/genetlink.h>
|
|
||||||
+
|
|
||||||
+void test(void)
|
|
||||||
+{
|
|
||||||
+ struct genl_family family = { };
|
|
||||||
+ struct genl_ops ops[23];
|
|
||||||
+
|
|
||||||
+ genl_register_family_with_ops(&family, ops);
|
|
||||||
+}
|
|
||||||
diff --git a/drbd/compat/tests/have_genl_register_family_with_ops3.c b/drbd/compat/tests/have_genl_register_family_with_ops3.c
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..11b6d73
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/drbd/compat/tests/have_genl_register_family_with_ops3.c
|
|
||||||
@@ -0,0 +1,9 @@
|
|
||||||
+#include <net/genetlink.h>
|
|
||||||
+
|
|
||||||
+void test(void)
|
|
||||||
+{
|
|
||||||
+ struct genl_family family = { };
|
|
||||||
+ struct genl_ops ops[23];
|
|
||||||
+
|
|
||||||
+ genl_register_family_with_ops(&family, ops, 23);
|
|
||||||
+}
|
|
||||||
diff --git a/drbd/linux/genl_magic_func-genl_register_family_with_ops_groups.h b/drbd/linux/genl_magic_func-genl_register_family_with_ops_groups.h
|
|
||||||
index 27d8f73..403e8e2 100644
|
|
||||||
--- a/drbd/linux/genl_magic_func-genl_register_family_with_ops_groups.h
|
|
||||||
+++ b/drbd/linux/genl_magic_func-genl_register_family_with_ops_groups.h
|
|
||||||
@@ -29,9 +29,13 @@ static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \
|
|
||||||
|
|
||||||
int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void)
|
|
||||||
{
|
|
||||||
+#if defined(COMPAT_HAVE_GENL_REGISTER_FAMILY_WITH_OPS) || defined(COMPAT_HAVE_GENL_REGISTER_FAMILY_WITH_OPS3)
|
|
||||||
return genl_register_family_with_ops_groups(&ZZZ_genl_family, \
|
|
||||||
ZZZ_genl_ops, \
|
|
||||||
ZZZ_genl_mcgrps);
|
|
||||||
+#else
|
|
||||||
+ return genl_register_family(&ZZZ_genl_family);
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void)
|
|
||||||
diff --git a/drbd/linux/genl_magic_func.h b/drbd/linux/genl_magic_func.h
|
|
||||||
index 29f44a8..504719a 100644
|
|
||||||
--- a/drbd/linux/genl_magic_func.h
|
|
||||||
+++ b/drbd/linux/genl_magic_func.h
|
|
||||||
@@ -261,15 +261,7 @@ static struct genl_ops ZZZ_genl_ops[] __read_mostly = {
|
|
||||||
* {{{2
|
|
||||||
*/
|
|
||||||
#define ZZZ_genl_family CONCAT_(GENL_MAGIC_FAMILY, _genl_family)
|
|
||||||
-static struct genl_family ZZZ_genl_family __read_mostly = {
|
|
||||||
- .id = GENL_ID_GENERATE,
|
|
||||||
- .name = __stringify(GENL_MAGIC_FAMILY),
|
|
||||||
- .version = GENL_MAGIC_VERSION,
|
|
||||||
-#ifdef GENL_MAGIC_FAMILY_HDRSZ
|
|
||||||
- .hdrsize = NLA_ALIGN(GENL_MAGIC_FAMILY_HDRSZ),
|
|
||||||
-#endif
|
|
||||||
- .maxattr = ARRAY_SIZE(drbd_tla_nl_policy)-1,
|
|
||||||
-};
|
|
||||||
+static struct genl_family ZZZ_genl_family;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Magic: define multicast groups
|
|
||||||
@@ -282,13 +274,35 @@ static struct genl_family ZZZ_genl_family __read_mostly = {
|
|
||||||
* genetlink: pass family to functions using groups
|
|
||||||
* genetlink: only pass array to genl_register_family_with_ops()
|
|
||||||
* which are commits c53ed742..2a94fe48
|
|
||||||
+ *
|
|
||||||
+ * v4.10, 489111e5 genetlink: statically initialize families
|
|
||||||
+ * and previous commit drop GENL_ID_GENERATE and register helper functions.
|
|
||||||
*/
|
|
||||||
-#ifdef genl_register_family_with_ops_groups
|
|
||||||
+#if defined(genl_register_family_with_ops_groups) || !defined(GENL_ID_GENERATE)
|
|
||||||
#include <linux/genl_magic_func-genl_register_family_with_ops_groups.h>
|
|
||||||
#else
|
|
||||||
#include <linux/genl_magic_func-genl_register_mc_group.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+static struct genl_family ZZZ_genl_family __read_mostly = {
|
|
||||||
+ /* .id = GENL_ID_GENERATE, which exists no longer, and was 0 anyways */
|
|
||||||
+ .name = __stringify(GENL_MAGIC_FAMILY),
|
|
||||||
+ .version = GENL_MAGIC_VERSION,
|
|
||||||
+#ifdef GENL_MAGIC_FAMILY_HDRSZ
|
|
||||||
+ .hdrsize = NLA_ALIGN(GENL_MAGIC_FAMILY_HDRSZ),
|
|
||||||
+#endif
|
|
||||||
+ .maxattr = ARRAY_SIZE(CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy))-1,
|
|
||||||
+
|
|
||||||
+#ifndef GENL_ID_GENERATE
|
|
||||||
+ .ops = ZZZ_genl_ops,
|
|
||||||
+ .n_ops = ARRAY_SIZE(ZZZ_genl_ops),
|
|
||||||
+ .mcgrps = ZZZ_genl_mcgrps,
|
|
||||||
+ .n_mcgrps = ARRAY_SIZE(ZZZ_genl_mcgrps),
|
|
||||||
+ .module = THIS_MODULE,
|
|
||||||
+#endif
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* Magic: provide conversion functions {{{1
|
|
||||||
* populate skb from struct.
|
|
||||||
--
|
|
||||||
1.8.3.1
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user