Accepting request 878475 from home:wanghaisu:branches:network:ha-clustering:Factory
bsc#1183429, compat to kernel v5.11 OBS-URL: https://build.opensuse.org/request/show/878475 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=126
This commit is contained in:
parent
c42d1c5129
commit
7cbf74c985
181
compat_to_v5_11.patch
Normal file
181
compat_to_v5_11.patch
Normal file
@ -0,0 +1,181 @@
|
||||
1. <asm/kmap_types.h> removed in 2a00bda85659
|
||||
2. revalidate_disk_size() change to set_capacity_and_notify() in bc254eb44f9dfce278b53b714fb7bb963253789d
|
||||
3. "policy" of "genl_ops" removed in 3b0f31f2b8c9fb348e4530b88f6b64f9621f83d6. Then add back in 48526a0f4ca2b484cab4318dc0b2c2be1d8685b7
|
||||
4. "bd_contains" removed in a954ea812018a84d350b316c39a2be3edc4b7ca8
|
||||
5. "nla_strlcpy" rename to "nla_strscpy" in 872f690341948b502c93318f806d821c56772c42
|
||||
6. "bdget_disk" unexport in 977115c0f664e016a6b2774d4f97116ade23d732
|
||||
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_bitmap.c drbd-9.0.26~0+git.9114a038/drbd/drbd_bitmap.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_bitmap.c 2021-03-11 14:18:33.741746240 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd_bitmap.c 2021-03-11 14:22:06.083147488 +0800
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/dynamic_debug.h>
|
||||
#include <linux/libnvdimm.h>
|
||||
-#include <asm/kmap_types.h>
|
||||
+#include <linux/highmem.h>
|
||||
|
||||
#include "drbd_int.h"
|
||||
#include "drbd_dax_pmem.h"
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-headers/linux/genl_magic_struct.h drbd-9.0.26~0+git.9114a038/drbd/drbd-headers/linux/genl_magic_struct.h
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-headers/linux/genl_magic_struct.h 2021-03-11 14:18:33.729746150 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-headers/linux/genl_magic_struct.h 2021-03-12 15:26:38.358285613 +0800
|
||||
@@ -104,9 +104,15 @@
|
||||
#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)
|
||||
+#if !defined(COMPAT_HAVE_NLA_STRLCPY)
|
||||
+#define __str_field(attr_nr, attr_flag, name, maxlen) \
|
||||
+ __array(attr_nr, attr_flag, name, NLA_NUL_STRING, char, maxlen, \
|
||||
+ nla_strscpy, nla_put, false)
|
||||
+#else
|
||||
#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)
|
||||
+#endif
|
||||
#define __bin_field(attr_nr, attr_flag, name, maxlen) \
|
||||
__array(attr_nr, attr_flag, name, NLA_BINARY, char, maxlen, \
|
||||
nla_memcpy, nla_put, false)
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/gen_patch_names.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/gen_patch_names.c 2021-03-11 14:18:33.741746240 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/gen_patch_names.c 2021-03-11 16:05:05.119629643 +0800
|
||||
@@ -242,8 +242,10 @@
|
||||
patch(1, "bio_free", false, true,
|
||||
COMPAT_HAVE_BIO_FREE, "present");
|
||||
|
||||
+#if !defined(COMPAT_GENL_MAXATTR_IN_OPS)
|
||||
patch(1, "genl_policy", false, true,
|
||||
COMPAT_GENL_POLICY_IN_OPS, "in_ops");
|
||||
+#endif
|
||||
|
||||
patch(1, "blk_queue_merge_bvec", false, true,
|
||||
COMPAT_HAVE_BLK_QUEUE_MERGE_BVEC, "present");
|
||||
@@ -384,9 +386,11 @@
|
||||
#if defined(COMPAT_HAVE_REVALIDATE_DISK_SIZE)
|
||||
/* revalidate_disk_size is there, nothing to do */
|
||||
#else
|
||||
+#if !defined(COMPAT_HAVE_SET_CAPACITY_AND_NOTIFY)
|
||||
patch(1, "revalidate_disk_size", true, false,
|
||||
NO, "present");
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/* #define BLKDEV_ISSUE_ZEROOUT_EXPORTED */
|
||||
/* #define BLKDEV_ZERO_NOUNMAP */
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/genl_maxattr_in_ops.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/genl_maxattr_in_ops.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/genl_maxattr_in_ops.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/genl_maxattr_in_ops.c 2021-03-11 16:03:52.607001083 +0800
|
||||
@@ -0,0 +1,3 @@
|
||||
+#include <net/genetlink.h>
|
||||
+
|
||||
+struct genl_ops ops = { .maxattr = 1, };
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_blk_device_bd_contains.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_blk_device_bd_contains.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_blk_device_bd_contains.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_blk_device_bd_contains.c 2021-03-12 14:03:28.103084480 +0800
|
||||
@@ -0,0 +1,4 @@
|
||||
+/* {"commit":"a954ea812018a84d350b316c39a2be3edc4b7ca8"} */
|
||||
+#include <linux/blk_types.h>
|
||||
+
|
||||
+struct block_device bdevice = { .bd_contains = NULL, };
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_nla_strlcpy.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_nla_strlcpy.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_nla_strlcpy.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_nla_strlcpy.c 2021-03-12 15:25:46.829872085 +0800
|
||||
@@ -0,0 +1,10 @@
|
||||
+/* {"commit":"872f690341948b502c93318f806d821c56772c42"} */
|
||||
+#include <net/netlink.h>
|
||||
+
|
||||
+void foo(void) {
|
||||
+ char d;
|
||||
+ struct nlattr nla;
|
||||
+ size_t dstsize;
|
||||
+
|
||||
+ nla_strlcpy(&d, &nla, dstsize);
|
||||
+}
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_set_capacity_and_notify.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_set_capacity_and_notify.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_set_capacity_and_notify.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_set_capacity_and_notify.c 2021-03-11 14:55:34.269935216 +0800
|
||||
@@ -0,0 +1,8 @@
|
||||
+/* { "version": "v5.11-rc1", "commit": "449f4ec9892ebc2f37a7eae6d97db2cf7c65e09a", "comment": "remove the update_bdev parameter to set_capacity_revalidate_and_notify", "author": "Christoph Hellwig <hch@lst.de>", "date": "Mon Nov 16 15:56:56 2020 +0100" } */
|
||||
+
|
||||
+#include <linux/genhd.h>
|
||||
+
|
||||
+void foo(struct gendisk *disk, sector_t size)
|
||||
+{
|
||||
+ set_capacity_and_notify(disk, size);
|
||||
+}
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_nl.c drbd-9.0.26~0+git.9114a038/drbd/drbd_nl.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_nl.c 2021-03-11 14:18:33.741746240 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd_nl.c 2021-03-12 15:04:01.031546110 +0800
|
||||
@@ -1033,10 +1033,14 @@
|
||||
} else /* (role == R_SECONDARY) */ {
|
||||
down(&resource->state_sem);
|
||||
idr_for_each_entry(&resource->devices, device, vnr) {
|
||||
+#if defined(BDGET_DISK_EXPORTED)
|
||||
bdev = bdget_disk(device->vdisk, 0);
|
||||
if (bdev)
|
||||
fsync_bdev(bdev);
|
||||
bdput(bdev);
|
||||
+#else
|
||||
+ bdev = device->vdisk->part0;
|
||||
+#endif
|
||||
flush_workqueue(device->submit.wq);
|
||||
}
|
||||
|
||||
@@ -1525,8 +1529,12 @@
|
||||
{
|
||||
char ppb[10];
|
||||
|
||||
+#if defined(COMPAT_HAVE_SET_CAPACITY_AND_NOTIFY)
|
||||
+ set_capacity_and_notify(device->vdisk, size);
|
||||
+#else
|
||||
set_capacity(device->vdisk, size);
|
||||
revalidate_disk_size(device->vdisk, false);
|
||||
+#endif
|
||||
|
||||
drbd_info(device, "size = %s (%llu KB)\n",
|
||||
ppsize(ppb, size>>1), (unsigned long long)size>>1);
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_receiver.c drbd-9.0.26~0+git.9114a038/drbd/drbd_receiver.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_receiver.c 2021-03-11 14:18:33.729746150 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd_receiver.c 2021-03-12 14:07:34.632961219 +0800
|
||||
@@ -3206,7 +3206,11 @@
|
||||
bool drbd_rs_c_min_rate_throttle(struct drbd_peer_device *peer_device)
|
||||
{
|
||||
struct drbd_device *device = peer_device->device;
|
||||
+#if defined(COMPAT_HAVE_BLK_DEVICE_BD_CONTAINS)
|
||||
struct hd_struct *part = &device->ldev->backing_bdev->bd_contains->bd_disk->part0;
|
||||
+#else
|
||||
+ struct block_device *part = device->ldev->backing_bdev->bd_disk->part0;
|
||||
+#endif
|
||||
unsigned long db, dt, dbdt;
|
||||
unsigned int c_min_rate;
|
||||
int curr_events;
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_sender.c drbd-9.0.26~0+git.9114a038/drbd/drbd_sender.c
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_sender.c 2021-03-11 14:18:33.741746240 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd_sender.c 2021-03-12 14:07:41.537013782 +0800
|
||||
@@ -1930,7 +1930,11 @@
|
||||
void drbd_rs_controller_reset(struct drbd_peer_device *peer_device)
|
||||
{
|
||||
struct fifo_buffer *plan;
|
||||
+#if defined(COMPAT_HAVE_BLK_DEVICE_BD_CONTAINS)
|
||||
struct hd_struct *part = &peer_device->device->ldev->backing_bdev->bd_contains->bd_disk->part0;
|
||||
+#else
|
||||
+ struct block_device *part = peer_device->device->ldev->backing_bdev->bd_disk->part0;
|
||||
+#endif
|
||||
|
||||
atomic_set(&peer_device->rs_sect_in, 0);
|
||||
atomic_set(&peer_device->device->rs_sect_ev, 0); /* FIXME: ??? */
|
||||
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/Kbuild drbd-9.0.26~0+git.9114a038/drbd/Kbuild
|
||||
--- drbd-9.0.26~0+git.9114a038.orig/drbd/Kbuild 2021-03-11 14:18:33.729746150 +0800
|
||||
+++ drbd-9.0.26~0+git.9114a038/drbd/Kbuild 2021-03-12 14:46:39.155333558 +0800
|
||||
@@ -45,6 +45,11 @@
|
||||
endif
|
||||
compat_objs += drbd-kernel-compat/drbd_wrappers.o
|
||||
|
||||
+ifeq ($(shell grep -e '\<bdget_disk\>' \
|
||||
+ $(objtree)/Module.symvers | wc -l),1)
|
||||
+override EXTRA_CFLAGS += -DBDGET_DISK_EXPORTED
|
||||
+endif
|
||||
+
|
||||
ifdef CONFIG_DEV_DAX_PMEM
|
||||
ifneq ($(shell grep -e '\<arch_wb_cache_pmem\>' $(objtree)/Module.symvers | wc -l),1)
|
||||
override EXTRA_CFLAGS += -DDAX_PMEM_IS_INCOMPLETE
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 12 07:10:37 UTC 2021 - nick wang <nwang@suse.com>
|
||||
|
||||
- bsc#1183429, compat to kernel v5.11
|
||||
Add patch compat_to_v5_11.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 9 06:40:33 UTC 2020 - nick wang <nwang@suse.com>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package drbd
|
||||
#
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -46,6 +46,8 @@ Patch7: compat_blk_queue_stack_limits.patch
|
||||
#compat to v5.10
|
||||
Patch8: remove_bdi_cap_stable_writes.patch
|
||||
Patch9: compat_get_fs.patch
|
||||
#compat to v5.11, no need to sle15sp3
|
||||
Patch10: compat_to_v5_11.patch
|
||||
Patch99: suse-coccinelle.patch
|
||||
#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py
|
||||
BuildRequires: coccinelle >= 1.0.8
|
||||
@ -88,6 +90,7 @@ installed kernel.
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch99 -p1
|
||||
|
||||
mkdir source
|
||||
|
Loading…
Reference in New Issue
Block a user