Accepting request 891196 from network:ha-clustering:Factory

OBS-URL: https://build.opensuse.org/request/show/891196
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/drbd?expand=0&rev=92
This commit is contained in:
Dominique Leuenberger 2021-05-07 14:45:44 +00:00 committed by Git OBS Bridge
commit 84e35e06ef
16 changed files with 155 additions and 505 deletions

View File

@ -9,9 +9,9 @@
This will download branch first instead of tag.
<param name="revision">drbd-9.0</param>
<param name="version">9.0.26~0</param>
<param name="version">9.0.29~0</param>
-->
<param name="versionformat">9.0.26~0+git.%h</param>
<param name="versionformat">9.0.29~0+git.%h</param>
<param name="revision">drbd-9.0</param>
</service>

View File

@ -1,20 +0,0 @@
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_blkdev_get_by_path.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_blkdev_get_by_path.c
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_blkdev_get_by_path.c 2020-12-08 22:03:48.629954854 +0800
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_blkdev_get_by_path.c 2020-12-09 09:40:51.499642818 +0800
@@ -1,4 +1,5 @@
#include <linux/fs.h>
+#include <linux/blkdev.h>
/*
* In kernel version 2.6.38-rc1, open_bdev_exclusive() was replaced by
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_submit_bio.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_submit_bio.c
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_submit_bio.c 2020-12-08 22:03:48.629954854 +0800
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_submit_bio.c 2020-12-08 22:04:10.174672508 +0800
@@ -1,6 +1,7 @@
/* { "version": "v5.8", "commit": "c62b37d96b6eb3ec5ae4cbe00db107bf15aebc93", "comment": "Since 5.8 make_request_fn has been replaced by a block_device_operations method called submit_bio", "author": "Christoph Hellwig <hch@lst.de>", "date": "Wed Jul 1 10:59:43 2020 +0200" } */
#include <linux/blk_types.h>
+#include <linux/blkdev.h>
void foo(struct block_device_operations *ops)
{

View File

@ -1,36 +0,0 @@
1. c9ec0524 convert sched_setscheduler to sched_set_fifo*
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_sched_set_fifo_low.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_sched_set_fifo_low.c
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_sched_set_fifo_low.c 1970-01-01 08:00:00.000000000 +0800
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_sched_set_fifo_low.c 2020-10-20 10:48:02.070702635 +0800
@@ -0,0 +1,7 @@
+/* 6d2b84a4e and c9ec052470 Convert set_scheduler to sched_set_fifo* */
+#include <linux/sched.h>
+
+void test(struct task_struct *p)
+{
+ sched_set_fifo_low(p);
+}
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_receiver.c drbd-9.0.25~0+git.bd41626d/drbd/drbd_receiver.c
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_receiver.c 2020-10-20 10:48:14.058793953 +0800
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd_receiver.c 2020-10-20 11:11:32.948922212 +0800
@@ -9241,13 +9241,18 @@
unsigned int header_size = drbd_header_size(connection);
int expect = header_size;
bool ping_timeout_active = false;
- struct sched_param param = { .sched_priority = 2 };
struct drbd_transport *transport = &connection->transport;
struct drbd_transport_ops *tr_ops = transport->ops;
+#ifdef COMPAT_HAVE_SCHED_SET_FIFO_LOW
+ sched_set_fifo_low(current);
+#else
+ struct sched_param param = { .sched_priority = 2 };
rv = sched_setscheduler(current, SCHED_RR, &param);
+
if (rv < 0)
drbd_err(connection, "drbd_ack_receiver: ERROR set priority, ret=%d\n", rv);
+#endif
while (get_t_state(thi) == RUNNING) {
drbd_thread_current_set_cpu(thi);

View File

@ -0,0 +1,24 @@
1. "policy" of "genl_ops" removed in 3b0f31f2b8c9fb348e4530b88f6b64f9621f83d6. Then add back in 48526a0f4ca2b484cab4318dc0b2c2be1d8685b7
diff -Naur drbd-9.0.29~0+git.9a7bc817.orig/drbd/drbd-kernel-compat/gen_patch_names.c drbd-9.0.29~0+git.9a7bc817/drbd/drbd-kernel-compat/gen_patch_names.c
--- drbd-9.0.29~0+git.9a7bc817.orig/drbd/drbd-kernel-compat/gen_patch_names.c 2021-05-07 13:31:20.629024504 +0800
+++ drbd-9.0.29~0+git.9a7bc817/drbd/drbd-kernel-compat/gen_patch_names.c 2021-05-07 13:33:05.932908956 +0800
@@ -247,8 +247,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");
diff -Naur drbd-9.0.29~0+git.9a7bc817.orig/drbd/drbd-kernel-compat/tests/genl_maxattr_in_ops.c drbd-9.0.29~0+git.9a7bc817/drbd/drbd-kernel-compat/tests/genl_maxattr_in_ops.c
--- drbd-9.0.29~0+git.9a7bc817.orig/drbd/drbd-kernel-compat/tests/genl_maxattr_in_ops.c 1970-01-01 08:00:00.000000000 +0800
+++ drbd-9.0.29~0+git.9a7bc817/drbd/drbd-kernel-compat/tests/genl_maxattr_in_ops.c 2021-05-07 13:32:16.452960387 +0800
@@ -0,0 +1,4 @@
+#include <net/genetlink.h>
+
+struct genl_ops ops = { .maxattr = 1, };
+

View File

@ -1,49 +0,0 @@
3d13f313c, Add force_uaccess_{begin,end} helpers for get_fs/set_fs
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_force_uaccess_begin.c drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_force_uaccess_begin.c
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/tests/have_force_uaccess_begin.c 1970-01-01 08:00:00.000000000 +0800
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/tests/have_force_uaccess_begin.c 2020-12-09 19:36:17.554021899 +0800
@@ -0,0 +1,7 @@
+/* 3d13f313c Add force_uaccess_{begin,end} helpers for get_fs/set_fs */
+#include <linux/uaccess.h>
+
+void dummy(void)
+{
+ force_uaccess_begin();
+}
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_transport_tcp.c drbd-9.0.26~0+git.9114a038/drbd/drbd_transport_tcp.c
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_transport_tcp.c 2020-12-09 19:35:57.493892623 +0800
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd_transport_tcp.c 2020-12-09 19:40:44.863689731 +0800
@@ -1145,7 +1145,12 @@
struct drbd_tcp_transport *tcp_transport =
container_of(transport, struct drbd_tcp_transport, transport);
struct socket *socket = tcp_transport->stream[stream];
+#ifdef COMPAT_HAVE_FORCE_UACCESS_BEGIN
+ mm_segment_t oldfs = force_uaccess_begin();
+#else
mm_segment_t oldfs = get_fs();
+ set_fs(KERNEL_DS);
+#endif
int len = size;
int err = -EIO;
@@ -1154,7 +1159,6 @@
msg_flags |= MSG_NOSIGNAL;
dtt_update_congested(tcp_transport);
- set_fs(KERNEL_DS);
do {
int sent;
@@ -1180,7 +1184,11 @@
* and add that to the while() condition below.
*/
} while (len > 0 /* THINK && peer_device->repl_state[NOW] >= L_ESTABLISHED */);
+#ifdef COMPAT_HAVE_FORCE_UACCESS_BEGIN
+ force_uaccess_end(oldfs);
+#else
set_fs(oldfs);
+#endif
clear_bit(NET_CONGESTED, &tcp_transport->transport.flags);
if (len == 0)

View File

@ -1,17 +0,0 @@
[ 11s] In file included from /home/abuild/rpmbuild/BUILD/drbd-9.0.24~1+git.17730ea3/default/drbd_main.c:19:
[ 11s] /usr/src/linux-5.8.0-1/include/linux/vermagic.h:6:2: error: #error "This header can be included from kernel/module.c or *.mod.c only"
[ 11s] 6 | #error "This header can be included from kernel/module.c or *.mod.c only"
[ 11s] | ^~~~~
[ 11s] CC [M] /home/abuild/rpmbuild/BUILD/drbd-9.0.24~1+git.17730ea3/default/drbd_strings.o
diff -Naur drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd_main.c drbd-9.0.24~1+git.17730ea3/drbd/drbd_main.c
--- drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd_main.c 2020-08-13 14:22:17.895201728 +0800
+++ drbd-9.0.24~1+git.17730ea3/drbd/drbd_main.c 2020-08-13 14:44:14.849369576 +0800
@@ -16,7 +16,6 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
-#include <linux/vermagic.h>
#include <linux/jiffies.h>
#include <linux/drbd.h>
#include <linux/uaccess.h>

View File

@ -1,37 +0,0 @@
kernel_setsockopt removed in cb8e59cc
[ 13s] /home/abuild/rpmbuild/BUILD/drbd-9.0.24~1+git.17730ea3/default/drbd_transport_tcp.c: In function 'dtt_nodelay':
[ 13s] /home/abuild/rpmbuild/BUILD/drbd-9.0.24~1+git.17730ea3/default/drbd_transport_tcp.c:158:9: error: implicit declaration of funct
ion 'kernel_setsockopt'; did you mean 'kernel_getsockname'? [-Werror=implicit-function-declaration]
[ 13s] 158 | (void) kernel_setsockopt(socket, SOL_TCP, TCP_NODELAY, (char *)&val, sizeof(val));
[ 13s] | ^~~~~~~~~~~~~~~~~ [ 13s] | kernel_getsockname
[ 14s] cc1: some warnings being treated as errors
In 518846b54, some kernel_setsockopt() are removed, but not all...
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_transport_tcp.c drbd-9.0.26~0+git.9114a038/drbd/drbd_transport_tcp.c
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_transport_tcp.c 2020-12-09 14:06:22.117468473 +0800
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd_transport_tcp.c 2020-12-09 14:06:54.989546999 +0800
@@ -883,7 +883,6 @@
struct socket *dsocket, *csocket;
struct net_conf *nc;
int timeout, err;
- int one = 1;
bool ok;
dsocket = NULL;
@@ -1065,9 +1064,14 @@
dsocket->sk->sk_sndtimeo = timeout;
csocket->sk->sk_sndtimeo = timeout;
+#ifndef COMPAT_HAVE_TCP_SOCK_SET_CORK
+ int one = 1;
err = kernel_setsockopt(dsocket, SOL_SOCKET, SO_KEEPALIVE, (char *)&one, sizeof(one));
if (err)
tr_warn(transport, "Failed to enable SO_KEEPALIVE %d\n", err);
+#else
+ sock_set_keepalive(dsocket->sk);
+#endif
return 0;

View File

@ -1,181 +0,0 @@
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

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e25e22596e35dc77e2a448f4ef81b804256ca781676a6e44a54876e6bee5c2f5
size 359845

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1c662ff2c888521e9dc9d2684a4b75a093b4f80f91b93f7caaf9e4ebb84c568
size 371450

View File

@ -1,41 +0,0 @@
From 55293e6d7064c39183c3622c63ef6c2ab7162b80 Mon Sep 17 00:00:00 2001
From: Nick Wang <nwang@suse.com>
Date: Wed, 11 Dec 2019 14:50:21 +0800
Subject: [PATCH] drbd: fix zero metadata limit by misaligned with page size
Metadata is aligned on 4k blocks, which is ok for x86 platform.
But may cause a result of zero page with PPC64LE or ARM with
64k page size.
And calculate effective bytes directly from sector size.
Error log:
...
drbd0: Device size clipped from 2097016s to 0s due to metadata size
...
Signed-off-by: Nick Wang <nwang@suse.com>
CC: drbd-dev@lists.linbit.com
---
drbd/drbd_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c
index a7294639..336a4177 100644
--- a/drbd/drbd_main.c
+++ b/drbd/drbd_main.c
@@ -5589,8 +5589,7 @@ u64 directly_connected_nodes(struct drbd_resource *resource, enum which_state wh
static sector_t bm_sect_to_max_capacity(unsigned int bm_max_peers, sector_t bm_sect)
{
- u64 bm_pages = bm_sect >> (PAGE_SHIFT - SECTOR_SHIFT);
- u64 bm_bytes = bm_pages << PAGE_SHIFT;
+ u64 bm_bytes = bm_sect << SECTOR_SHIFT;
u64 bm_bytes_per_peer = div_u64(bm_bytes, bm_max_peers);
u64 bm_bits_per_peer = bm_bytes_per_peer * BITS_PER_BYTE;
return BM_BIT_TO_SECT(bm_bits_per_peer);
--
2.16.4

View File

@ -1,3 +1,83 @@
-------------------------------------------------------------------
Fri May 7 05:53:20 UTC 2021 - nick wang <nwang@suse.com>
- Update to 9.0.29
* fix data corruption when DRBD's backing disk is a degraded Linux software
raid (MD)
* add correct thawing of IO requests after IO was frozen due to loss of quorum
* fix timeout detection after idle periods and for configs with ko-count
when a disk on an a secondary stops delivering IO-completion events
* fixed an issue where UUIDs where not shifted in the history slots; that
caused false "unrelated data" events
* fix switching resync sources by letting resync requests drain before
issuing resync requests to the new source; before the fix, it could happen
that the resync does not terminate since a late reply from the previous
caused a out-of-sync bit set after the "scan point"
* fix a temporal deadlock you could trigger when you exercise promotion races
and mix some read-only openers into the test case
* fix for bitmap-copy operation in a very specific and unlikely case where
two nodes do a bitmap-based resync due to disk-states
* fix size negotiation when combining nodes of different CPU architectures
that have different page sizes
* fix a very rare race where DRBD reported wrong magic in a header
packet right after reconnecting
* fix a case where DRBD ends up reporting unrelated data; it affected
thinly allocated resources with a diskless node in a recreate from day0
event
* speedup open() of drbd devices if promote has not chance to go through
* new option "--reset-bitmap=no" for the invalidate and invalidate-remote
commands; this allows to do a resync after online verify found differences
* changes to socket buffer sizes get applied to established connections
immediately; before it was applied after a re-connect
* add exists events for path objects
* forbid keyed hash algorithms for online verify, csyms and HMAC base alg
* fix a regression introduces with 9.0.25; it failed to determine the
right device size and the connection hangs in WFBitmapS/WFBitmapT
repl state; to trigger this you need to do a partial resync to a
new node with different backing device size
* fix an issue with netlink packets processed in parallel on multiple
CPUs; the bug caused drbdadm adjust failing in very rare cases
* fix a very rare occurrence of a reconciliation resync getting stuck
* fix a race condition that causes a detach operation to hang; it
is very hard to trigger
* fix a kernel OOPS (via a BUG()) upon adding a timer twice under very rare
timing
* fix a counter imbalance that could lead to assertion messages when a
protocol A peer disconnects with a certain timing
* fix a rare race with receiving bitmap and a state change while
establishing a connection
* fix UUID handling to avoid false split-brain detections; this bug got
triggered an isolated primary that gets demoted, and temporal network
interruptions among the remaining nodes
* fix resync decision to obey disk states when the generation UUIDs are
equal; the effect of this bug was that you could end up with two Outdated
nodes after resync
* fix concurrent disk-attach operations
* Fix possible kernel warning regarding an inbalance of backing device
link/unlink
* move some amount of kernel backward compatibility code moved from the old
method (drbd_wrappers.h) to new cocci semantic patches
* add support renaming resources while its devices might be in use and
process IO requests
* Allow setting c_max_rate to 0 with the meaning that the resync controller
has no upper limit for the resync speed
* Fix regression: allow live migration between two diskful peers again
* following upstream changes to DRBD up to Linux 5.12 and updated compat
rules to support up to Linux 5.12
- Add patch compat_genl_maxattr_in_ops.patch (48526a0f)
Remove patch drbd-fix-zero-metadata-limit-by-page-size-misaligned.patch
Remove patch compat_remove_include_vermagic.patch
Remove patch compat-test-header.patch
Remove patch submit-bio-private-date.patch
Remove patch compat_remove_kernel_setsockopt.patch
Remove patch compat_blk_queue_stack_limits.patch
Remove patch remove_bdi_cap_stable_writes.patch
Remove patch compat_get_fs.patch
Remove patch compat_to_v5_11.patch
Modify patch suse-coccinelle.patch
- cocci apply: linux-5.12.0-2
queue_discard_zeroes_data__no_present (48920ff2a5a9)
-------------------------------------------------------------------
Fri Mar 12 07:10:37 UTC 2021 - nick wang <nwang@suse.com>

View File

@ -24,7 +24,7 @@
%endif
%endif
Name: drbd
Version: 9.0.26~0+git.9114a038
Version: 9.0.29~0+git.9a7bc817
Release: 0
Summary: Linux driver for the "Distributed Replicated Block Device"
License: GPL-2.0-or-later
@ -35,19 +35,7 @@ Source1: preamble
Source2: Module.supported
Source3: drbd_git_revision
Patch1: fix-resync-finished-with-syncs-have-bits-set.patch
Patch2: drbd-fix-zero-metadata-limit-by-page-size-misaligned.patch
#opensuse specific patch
Patch3: compat_remove_include_vermagic.patch
#compat to v5.9
Patch4: compat-test-header.patch
Patch5: submit-bio-private-date.patch
Patch6: compat_remove_kernel_setsockopt.patch
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
Patch2: compat_genl_maxattr_in_ops.patch
Patch99: suse-coccinelle.patch
#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py
BuildRequires: coccinelle >= 1.0.8
@ -83,14 +71,6 @@ installed kernel.
%setup -q -n drbd-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch99 -p1
mkdir source

View File

@ -1,22 +0,0 @@
IssueA: 1cb039f3dc1619eb795c54aad0a98fdb379b4237
BDI_CAP_STABLE_WRITES is removed.
QUEUE_FLAG_STABLE_WRITES is added
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/drbd_wrappers.h drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/drbd_wrappers.h
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd-kernel-compat/drbd_wrappers.h 2020-12-09 14:50:32.973058449 +0800
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd-kernel-compat/drbd_wrappers.h 2020-12-09 14:55:00.662701648 +0800
@@ -129,10 +129,14 @@
#ifdef BDI_CAP_STABLE_WRITES /* >= v3.9 */
#define set_bdi_cap_stable_writes(cap) do { (cap) |= BDI_CAP_STABLE_WRITES; } while (0)
+#else
+#ifdef QUEUE_FLAG_STABLE_WRITES /* >= v5.10 do nothing */
+#define set_bdi_cap_stable_writes(cap) do { } while (0)
#else /* < v3.9 */
#warning "BDI_CAP_STABLE_WRITES not available"
#define set_bdi_cap_stable_writes(cap) do { } while (0)
#endif
+#endif
#ifdef COMPAT_HAVE_POINTER_BACKING_DEV_INFO /* >= v4.11 */
#define bdi_from_device(device) (device->ldev->backing_bdev->bd_disk->queue->backing_dev_info)

View File

@ -1,23 +0,0 @@
missing change of bio->bi_disk->private_data;
opensuse don't have blk_queue_update_readahead
upstream commit c2e4cd57cfa1f
opensuse don't have revalidate_disk_size
upstream commit 659e56ba864d3
diff -Naur drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_req.c drbd-9.0.26~0+git.9114a038/drbd/drbd_req.c
--- drbd-9.0.26~0+git.9114a038.orig/drbd/drbd_req.c 2020-12-08 22:03:48.629954854 +0800
+++ drbd-9.0.26~0+git.9114a038/drbd/drbd_req.c 2020-12-09 10:45:04.390742754 +0800
@@ -2196,7 +2196,12 @@
blk_qc_t drbd_submit_bio(struct bio *bio)
{
+#ifdef COMPAT_HAVE_SUBMIT_BIO
+ struct drbd_device *device = bio->bi_disk->private_data;
+#else
struct drbd_device *device = (struct drbd_device *) q->queuedata;
+#endif
+
#ifdef CONFIG_DRBD_TIMING_STATS
ktime_t start_kt;
#endif

View File

@ -1,23 +1,27 @@
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/gen_compat_patch.sh
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh 2020-09-19 08:34:40.643919136 +0800
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/gen_compat_patch.sh 2020-09-19 08:50:59.095231966 +0800
@@ -44,9 +44,15 @@
diff -Naur drbd-9.0.29~0+git.9a7bc817.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh drbd-9.0.29~0+git.9a7bc817/drbd/drbd-kernel-compat/gen_compat_patch.sh
--- drbd-9.0.29~0+git.9a7bc817.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh 2021-05-07 11:24:44.877547149 +0800
+++ drbd-9.0.29~0+git.9a7bc817/drbd/drbd-kernel-compat/gen_compat_patch.sh 2021-05-07 12:30:58.385703306 +0800
@@ -44,9 +44,19 @@
if hash spatch && spatch_is_recent; then
K=$(cat $incdir/kernelrelease.txt)
+
+ echo " compat.h content ";
+ cat $incdir/compat.h;
+ echo " ------------------- ";
+
echo " GENPATCHNAMES "$K
gcc -I $incdir -o $incdir/gen_patch_names -std=c99 drbd-kernel-compat/gen_patch_names.c
$incdir/gen_patch_names > $incdir/applied_cocci_files.txt
+
+ echo " APPLIED_COCCI_FILES ";
+ cat $incdir/applied_cocci_files.txt;
+ echo " ------------------- ";
+
rm $incdir/gen_patch_names
rm -f $incdir/.compat.cocci
rm -f $incdir/.compat.patch
@@ -61,29 +67,46 @@
@@ -67,7 +77,15 @@
< drbd-kernel-compat/cocci/debugfs_compat_template.cocci.in \
>> $incdir/.compat.cocci
done
@ -27,58 +31,46 @@ diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/gen_compat_pa
+ echo " COCCI_LIBPATH: "$coccilibpath;
+
if [ -e $incdir/.compat.cocci ]; then
- echo " SPATCH $chksum "$K
- # Note: $* (or $@) is NOT make magic variable now, this is a shell script
- # make $@, the target file, was passed as $1, and is now $compat_patch
- # make $^, the source (and header) files spatch should operate on,
- # are "the rest of the shell argument array", so after shifting the first
- # argument away this is shell $@ respectively $* now.
- # we know we don't have white-space in the argument list
+ echo " GENCOCCIRULES .compat.cocci";
+ cat $incdir/.compat.cocci;
- command="spatch --sp-file $incdir/.compat.cocci $* --macro-file drbd-kernel-compat/cocci_macros.h --very-quiet > $compat_patch.tmp 2> $incdir/.spatch.stderr;"
+ echo " SPATCH $chksum "$K
+ # Note: $* (or $@) is NOT make magic variable now, this is a shell script
+ # make $@, the target file, was passed as $1, and is now $compat_patch
+ # make $^, the source (and header) files spatch should operate on,
+ # are "the rest of the shell argument array", so after shifting the first
+ # argument away this is shell $@ respectively $* now.
+ # we know we don't have white-space in the argument list
- if test -t 0; then
- $SHELL -c "$command"
- else
- # spatch is broken in a way: it "requires" a tty.
- # provide a tty using "script", so I can have several spatch in parallel.
- # They may ignore INT and TERM; if you have to, use HUP.
- </dev/null &> /dev/null script --append $incdir/.spatch.tty.out --return --quiet --command "$command"
- fi
+ command="spatch --sp-file $incdir/.compat.cocci $* --macro-file drbd-kernel-compat/cocci_macros.h --macro-file-builtins $coccilibpath/standard.h --iso-file $coccilibpath/standard.iso --very-quiet > $compat_patch.tmp 2> $incdir/.spatch.stderr;"
+ echo " SPATCH COMMAND $command ";
+ echo " GENCOCCIRULES .compat.cocci";
+ cat $incdir/.compat.cocci;
+
+ if test -t 0; then
+ $SHELL -c "$command"
+ else
+ # spatch is broken in a way: it "requires" a tty.
+ # provide a tty using "script", so I can have several spatch in parallel.
+ # They may ignore INT and TERM; if you have to, use HUP.
+ </dev/null &> /dev/null script --append $incdir/.spatch.tty.out --return --quiet --command "$command"
+ fi
else
- echo " SPATCH $chksum "$K" - nothing to do"
- touch $compat_patch.tmp
+ echo " SPATCH $chksum "$K" - nothing to do"
+ touch $compat_patch.tmp
+ fi
echo " SPATCH $chksum "$K
# Note: $* (or $@) is NOT make magic variable now, this is a shell script
# make $@, the target file, was passed as $1, and is now $compat_patch
@@ -77,8 +95,14 @@
# we know we don't have white-space in the argument list
set +e
+
+ command="spatch --sp-file $incdir/.compat.cocci $@ --macro-file drbd-kernel-compat/cocci_macros.h --macro-file-builtins $coccilibpath/standard.h --iso-file $coccilibpath/standard.iso --very-quiet --all-includes > $compat_patch.tmp 2> $incdir/.spatch.stderr"
+ echo " SPATCH COMMAND $command ";
+
spatch --sp-file "$incdir/.compat.cocci" "$@" \
--macro-file drbd-kernel-compat/cocci_macros.h \
+ --macro-file-builtins $coccilibpath/standard.h \
+ --iso-file $coccilibpath/standard.iso \
--very-quiet \
--all-includes \
> "$compat_patch.tmp" \
@@ -94,9 +118,21 @@
echo " SPATCH $chksum "$K" - nothing to do"
touch $compat_patch.tmp
fi
+
+ echo " GENSPATCHFILE $compat_patch.tmp ";
+ cat $compat_patch.tmp;
+
if [ -e $incdir/.compat.patch ]; then
+ echo " EXIST $incdir/.compat.patch ";
cat $incdir/.compat.patch >> $compat_patch.tmp
+ cat $compat_patch.tmp;
fi
+
+ if [ -e $incdir/.spatch.stderr ]; then
+ echo " GENSPATCHERR .spatch.stderr";
+ cat $incdir/.spatch.stderr;
fi
+ fi
+
if [ -e $incdir/.compat.patch ]; then
cat $incdir/.compat.patch >> $compat_patch.tmp
fi
mv $compat_patch.tmp $compat_patch
# keep it around
# to better be able to match the "stderr" warnings to their source files