diff --git a/_service b/_service index a529da5..4233d72 100644 --- a/_service +++ b/_service @@ -7,10 +7,10 @@ To update to a new release, change "revision" to the desired git commit hash and bump "version" if necessary - 9.0.1 + 9.0.2 --> - 9.0.1+git.%h - 86e443973082570aeb651848db89e0c7b995c306 + 9.0.2+git.%h + 14d2eead95f99a7de1c0b3e3f335a30b8d486bcb diff --git a/compat-4.7-1dee3f59-align-nla-u64.patch b/compat-4.7-1dee3f59-align-nla-u64.patch new file mode 100644 index 0000000..8804074 --- /dev/null +++ b/compat-4.7-1dee3f59-align-nla-u64.patch @@ -0,0 +1,34 @@ +diff -Naur drbd-9.0.2+git.14d2eea.orig/drbd-headers/linux/genl_magic_struct.h drbd-9.0.2+git.14d2eea/drbd-headers/linux/genl_magic_struct.h +--- drbd-9.0.2+git.14d2eea.orig/drbd-headers/linux/genl_magic_struct.h 2016-06-09 08:08:48.682443819 +0800 ++++ drbd-9.0.2+git.14d2eea/drbd-headers/linux/genl_magic_struct.h 2016-06-09 21:58:38.138780397 +0800 +@@ -13,7 +13,7 @@ + # error "you need to define GENL_MAGIC_INCLUDE_FILE before inclusion" + #endif + +-#include ++#include + #include + #include + #include "compat.h" +@@ -86,9 +86,21 @@ + __field(attr_nr, attr_flag, name, NLA_U32, __s32, \ + nla_get_u32, nla_put_u32, true) + #endif ++#ifdef COMPAT_HAVE_ALIGNED_NLA_U64_PAD + #define __u64_field(attr_nr, attr_flag, name) \ + __field(attr_nr, attr_flag, name, NLA_U64, __u64, \ + nla_get_u64, nla_put_u64, false) ++#else ++ ++static inline int nla_put_u64_0pad(struct sk_buff *skb, int attrtype, u64 value) ++{ ++ return nla_put_64bit(skb, attrtype, sizeof(u64), &value, 0); ++} ++ ++#define __u64_field(attr_nr, attr_flag, name) \ ++ __field(attr_nr, attr_flag, name, NLA_U64, __u64, \ ++ nla_get_u64, nla_put_u64_0pad, false) ++#endif + #define __str_field(attr_nr, attr_flag, name, maxlen) \ + __array(attr_nr, attr_flag, name, NLA_NUL_STRING, char, maxlen, \ + nla_strlcpy, nla_put, false) diff --git a/compat-4.7-50225243-kill-nla_put_u64.patch b/compat-4.7-50225243-kill-nla_put_u64.patch new file mode 100644 index 0000000..8281278 --- /dev/null +++ b/compat-4.7-50225243-kill-nla_put_u64.patch @@ -0,0 +1,10 @@ +diff -Naur drbd-9.0.2+git.14d2eea.orig/drbd/drbd-kernel-compat/tests/have_aligned_nla_u64_pad.c drbd-9.0.2+git.14d2eea/drbd/drbd-kernel-compat/tests/have_aligned_nla_u64_pad.c +--- drbd-9.0.2+git.14d2eea.orig/drbd/drbd-kernel-compat/tests/have_aligned_nla_u64_pad.c 1970-01-01 08:00:00.000000000 +0800 ++++ drbd-9.0.2+git.14d2eea/drbd/drbd-kernel-compat/tests/have_aligned_nla_u64_pad.c 2016-06-09 07:56:36.081322856 +0800 +@@ -0,0 +1,6 @@ ++#include ++ ++void foo(void) ++{ ++ nla_put_u64(NULL, 0, 0); ++} diff --git a/compat-4.7-9902af79-i_mutex.patch b/compat-4.7-9902af79-i_mutex.patch new file mode 100644 index 0000000..0413ff0 --- /dev/null +++ b/compat-4.7-9902af79-i_mutex.patch @@ -0,0 +1,31 @@ +diff --git a/drbd/drbd_debugfs.c b/drbd/drbd_debugfs.c +index 91292c3..959a576 100644 +--- a/drbd/drbd_debugfs.c ++++ b/drbd/drbd_debugfs.c +@@ -1074,7 +1074,7 @@ static int drbd_single_open_peer_device(struct file *file, + parent = file->f_path.dentry->d_parent; + if (!parent || !parent->d_inode) + goto out; +- mutex_lock(&parent->d_inode->i_mutex); ++ inode_lock(d_inode(parent)); + if (!simple_positive(file->f_path.dentry)) + goto out_unlock; + +@@ -1083,7 +1083,7 @@ static int drbd_single_open_peer_device(struct file *file, + + if (got_connection && got_device) { + int ret; +- mutex_unlock(&parent->d_inode->i_mutex); ++ inode_unlock(d_inode(parent)); + ret = single_open(file, show, peer_device); + if (ret) { + kref_put(&connection->kref, drbd_destroy_connection); +@@ -1097,7 +1097,7 @@ static int drbd_single_open_peer_device(struct file *file, + if (got_device) + kref_put(&device->kref, drbd_destroy_device); + out_unlock: +- mutex_unlock(&parent->d_inode->i_mutex); ++ inode_unlock(d_inode(parent)); + out: + return -ESTALE; + } diff --git a/compat-4.7-fe8fb75e-blk_queue_write_cache.patch b/compat-4.7-fe8fb75e-blk_queue_write_cache.patch new file mode 100644 index 0000000..a8865ba --- /dev/null +++ b/compat-4.7-fe8fb75e-blk_queue_write_cache.patch @@ -0,0 +1,24 @@ +diff -Naur drbd-9.0.2+git.14d2eea.orig/drbd/drbd-kernel-compat/drbd_wrappers.h drbd-9.0.2+git.14d2eea/drbd/drbd-kernel-compat/drbd_wrappers.h +--- drbd-9.0.2+git.14d2eea.orig/drbd/drbd-kernel-compat/drbd_wrappers.h 2016-06-08 17:52:23.920376490 +0800 ++++ drbd-9.0.2+git.14d2eea/drbd/drbd-kernel-compat/drbd_wrappers.h 2016-06-08 21:14:33.692708703 +0800 +@@ -677,6 +677,10 @@ + #define blk_queue_max_hw_sectors(q, max) blk_queue_max_sectors(q, max) + #endif + ++#ifndef COMPAT_HAVE_BLK_QUEUE_FLUSH ++#define blk_queue_flush(q, f) blk_queue_write_cache(q, true, true) ++#endif ++ + #ifndef COMPAT_HAVE_BLK_QUEUE_MAX_SEGMENTS + static inline void blk_queue_max_segments(struct request_queue *q, unsigned short max_segments) + { +diff -Naur drbd-9.0.2+git.14d2eea.orig/drbd/drbd-kernel-compat/tests/have_blk_queue_flush.c drbd-9.0.2+git.14d2eea/drbd/drbd-kernel-compat/tests/have_blk_queue_flush.c +--- drbd-9.0.2+git.14d2eea.orig/drbd/drbd-kernel-compat/tests/have_blk_queue_flush.c 1970-01-01 08:00:00.000000000 +0800 ++++ drbd-9.0.2+git.14d2eea/drbd/drbd-kernel-compat/tests/have_blk_queue_flush.c 2016-06-08 21:13:40.324918430 +0800 +@@ -0,0 +1,6 @@ ++#include ++ ++void dummy(struct request_queue *q, unsigned int flush) ++{ ++ blk_queue_flush(q, flush); ++} diff --git a/drbd-9.0.1+git.86e4439.tar.bz2 b/drbd-9.0.1+git.86e4439.tar.bz2 deleted file mode 100644 index ea04949..0000000 --- a/drbd-9.0.1+git.86e4439.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6332f7aaed6766936f72c5b4f219411d86353c76d6354b43e656326e568b057c -size 282662 diff --git a/drbd-9.0.2+git.14d2eea.tar.bz2 b/drbd-9.0.2+git.14d2eea.tar.bz2 new file mode 100644 index 0000000..caa04cf --- /dev/null +++ b/drbd-9.0.2+git.14d2eea.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6b1003e42a0541b5a589d4576a8e4271e17aafbf595df40fd4b91cf87432d6e +size 288998 diff --git a/drbd.changes b/drbd.changes index 7f79766..5973f50 100644 --- a/drbd.changes +++ b/drbd.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Jun 8 06:03:05 UTC 2016 - nwang@suse.com + +- bsc#983633, upgrade to ver9.0.2 to build against kernel 4.6/4.7 +- Add patch compat-4.7-9902af79-i_mutex.patch +- Add patch compat-4.7-fe8fb75e-blk_queue_write_cache.patch +- Add patch compat-4.7-50225243-kill-nla_put_u64.patch +- Add patch compat-4.7-1dee3f59-align-nla-u64.patch + ------------------------------------------------------------------- Fri Apr 8 14:44:21 UTC 2016 - nwang@suse.com diff --git a/drbd.spec b/drbd.spec index 51dccd2..a249a4e 100644 --- a/drbd.spec +++ b/drbd.spec @@ -1,7 +1,7 @@ # # spec file for package drbd # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,7 +23,7 @@ %endif Name: drbd -Version: 9.0.1+git.86e4439 +Version: 9.0.2+git.14d2eea Release: 0 Summary: DRBD driver for Linux License: GPL-2.0 @@ -34,8 +34,13 @@ Source1: preamble #In kernel is: kernel/drivers/block/drbd/drbd.ko Source2: Module.supported Source3: drbd_git_revision -Patch0: kernel-4.5-compat.patch -Patch1: drbd-buildcompare.patch +Patch0: drbd-buildcompare.patch +Patch1: kernel-4.5-compat.patch +Patch2: compat-4.7-9902af79-i_mutex.patch +Patch3: compat-4.7-fe8fb75e-blk_queue_write_cache.patch +#Patch4 should work together with Patch5 +Patch4: compat-4.7-50225243-kill-nla_put_u64.patch +Patch5: compat-4.7-1dee3f59-align-nla-u64.patch BuildRequires: kernel-source BuildRequires: kernel-syms BuildRequires: module-init-tools @@ -71,6 +76,10 @@ installed kernel. %setup -q -n drbd-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 mkdir source cp -a drbd/. source/. || : diff --git a/drbd_git_revision b/drbd_git_revision index 0776ea3..82a8db6 100644 --- a/drbd_git_revision +++ b/drbd_git_revision @@ -1 +1 @@ -GIT-hash: 86e443973082570aeb651848db89e0c7b995c306 +GIT-hash: 14d2eead95f99a7de1c0b3e3f335a30b8d486bcb