Accepting request 854413 from network:ha-clustering:Factory
OBS-URL: https://build.opensuse.org/request/show/854413 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/drbd?expand=0&rev=90
This commit is contained in:
commit
a670e5fa44
4
_service
4
_service
@ -9,9 +9,9 @@
|
||||
|
||||
This will download branch first instead of tag.
|
||||
<param name="revision">drbd-9.0</param>
|
||||
<param name="version">9.0.25~0</param>
|
||||
<param name="version">9.0.26~0</param>
|
||||
-->
|
||||
<param name="versionformat">9.0.25~0+git.%h</param>
|
||||
<param name="versionformat">9.0.26~0+git.%h</param>
|
||||
<param name="revision">drbd-9.0</param>
|
||||
</service>
|
||||
|
||||
|
@ -1,139 +0,0 @@
|
||||
Together with generic_make_request change to submit_bio_noacct,
|
||||
patch compat_generic_make_request.patch
|
||||
|
||||
Adapted two upstream changes:
|
||||
c62b37d96b6eb v5.9-rc1~147^2~55
|
||||
move ->make_request_fn to struct
|
||||
block_device_operations
|
||||
f695ca3886ce7 v5.9-rc1~147^2~59
|
||||
remove the request_queue argument
|
||||
from blk_queue_split
|
||||
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_int.h drbd-9.0.25~0+git.bd41626d/drbd/drbd_int.h
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_int.h 2020-10-10 13:00:26.547933412 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd_int.h 2020-10-10 13:00:51.932114769 +0800
|
||||
@@ -1838,7 +1838,11 @@
|
||||
#define __drbd_make_request(d,b,k,j) __drbd_make_request(d,b,j)
|
||||
#endif
|
||||
extern void __drbd_make_request(struct drbd_device *, struct bio *, ktime_t, unsigned long);
|
||||
+#ifndef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
+extern blk_qc_t drbd_make_request(struct bio *bio);
|
||||
+#else
|
||||
extern blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio);
|
||||
+#endif
|
||||
|
||||
/* drbd_nl.c */
|
||||
enum suspend_scope {
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/gen_patch_names.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/gen_patch_names.c 2020-10-10 13:00:26.543933383 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/gen_patch_names.c 2020-10-10 13:00:51.932114769 +0800
|
||||
@@ -83,7 +83,7 @@
|
||||
patch(1, "block_device_operations_release", true, false,
|
||||
COMPAT_DRBD_RELEASE_RETURNS_VOID, "is_void");
|
||||
|
||||
-#if !defined(COMPAT_HAVE_BD_UNLINK_DISK_HOLDER) || defined(COMPAT_HAVE_BD_CLAIM_BY)
|
||||
+#if !defined(COMPAT_HAVE_BD_UNLINK_DISK_HOLDER) || defined(COMPAT_HAVE_BD_CLAIM_BY_DISK)
|
||||
patch(2, "claim_disk", true, false,
|
||||
COMPAT_HAVE_BD_UNLINK_DISK_HOLDER, "link",
|
||||
COMPAT_HAVE_BD_CLAIM_BY_DISK, "claim");
|
||||
@@ -130,11 +130,14 @@
|
||||
patch(1, "blk_queue_make_request", false, true,
|
||||
COMPAT_HAVE_BLK_QUEUE_MAKE_REQUEST, "present");
|
||||
|
||||
+/* together with generic_make_request change to submit_bio_noacct */
|
||||
+#ifdef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
#ifndef COMPAT_HAVE_BLK_QC_T_MAKE_REQUEST
|
||||
patch(2, "make_request", false, false,
|
||||
COMPAT_HAVE_BLK_QC_T_MAKE_REQUEST, "is_blk_qc_t",
|
||||
COMPAT_HAVE_VOID_MAKE_REQUEST, "is_void");
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
patch(1, "blkdev_get_by_path", true, false,
|
||||
COMPAT_HAVE_BLKDEV_GET_BY_PATH, "present");
|
||||
@@ -209,6 +212,8 @@
|
||||
patch(1, "blk_queue_merge_bvec", false, true,
|
||||
COMPAT_HAVE_BLK_QUEUE_MERGE_BVEC, "present");
|
||||
|
||||
+/* together with generic_make_request change to submit_bio_noacct */
|
||||
+#ifdef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
#if !defined(COMPAT_HAVE_BLK_QUEUE_SPLIT_Q_BIO)
|
||||
# if defined(COMPAT_HAVE_BLK_QUEUE_SPLIT_Q_BIO_BIOSET)
|
||||
/* if _BIOSET is true, it's the variant with 3 arguments */
|
||||
@@ -222,6 +227,7 @@
|
||||
NO, "present");
|
||||
# endif
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
patch(1, "security_netlink_recv", false, true,
|
||||
COMPAT_HAVE_SECURITY_NETLINK_RECV, "present");
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_blk_queue_split_q_bio.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_blk_queue_split_q_bio.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_blk_queue_split_q_bio.c 2020-10-10 13:00:26.543933383 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_blk_queue_split_q_bio.c 2020-10-10 13:03:31.905257690 +0800
|
||||
@@ -2,5 +2,10 @@
|
||||
|
||||
void dummy(struct request_queue *q, struct bio *bio)
|
||||
{
|
||||
+/* together with generic_make_request change to submit_bio_noacct */
|
||||
+#ifndef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
+ blk_queue_split(&bio);
|
||||
+#else
|
||||
blk_queue_split(q, &bio);
|
||||
+#endif
|
||||
}
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_main.c drbd-9.0.25~0+git.bd41626d/drbd/drbd_main.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_main.c 2020-10-10 13:00:26.547933412 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd_main.c 2020-10-10 13:00:51.936114797 +0800
|
||||
@@ -161,6 +161,9 @@
|
||||
.owner = THIS_MODULE,
|
||||
.open = drbd_open,
|
||||
.release = drbd_release,
|
||||
+#ifndef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
+ .submit_bio = drbd_make_request,
|
||||
+#endif
|
||||
};
|
||||
|
||||
struct bio *bio_alloc_drbd(gfp_t gfp_mask)
|
||||
@@ -3709,7 +3712,11 @@
|
||||
|
||||
init_rwsem(&device->uuid_sem);
|
||||
|
||||
+#ifndef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
+ q = blk_alloc_queue(NUMA_NO_NODE);
|
||||
+#else
|
||||
q = blk_alloc_queue(drbd_make_request, NUMA_NO_NODE);
|
||||
+#endif
|
||||
if (!q)
|
||||
goto out_no_q;
|
||||
device->rq_queue = q;
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_req.c drbd-9.0.25~0+git.bd41626d/drbd/drbd_req.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_req.c 2020-10-10 13:00:26.547933412 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd_req.c 2020-10-10 13:05:16.018001520 +0800
|
||||
@@ -2183,15 +2183,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#ifndef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
+blk_qc_t drbd_make_request(struct bio *bio)
|
||||
+{
|
||||
+ struct drbd_device *device = bio->bi_disk->private_data;
|
||||
+#else
|
||||
blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio)
|
||||
{
|
||||
struct drbd_device *device = (struct drbd_device *) q->queuedata;
|
||||
+#endif
|
||||
+
|
||||
#ifdef CONFIG_DRBD_TIMING_STATS
|
||||
ktime_t start_kt;
|
||||
#endif
|
||||
unsigned long start_jif;
|
||||
|
||||
+#ifndef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
+ blk_queue_split(&bio);
|
||||
+#else
|
||||
blk_queue_split(q, &bio);
|
||||
+#endif
|
||||
|
||||
if (device->cached_err_io) {
|
||||
bio->bi_status = BLK_STS_IOERR;
|
20
compat-test-header.patch
Normal file
20
compat-test-header.patch
Normal file
@ -0,0 +1,20 @@
|
||||
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)
|
||||
{
|
@ -1,35 +1,5 @@
|
||||
1. b9b1a5d7 blk_queue_stack_limits is removed
|
||||
2. 63a0895d and 3f649ab72 uninitialized_var() macro removed
|
||||
3. c9ec0524 convert sched_setscheduler to sched_set_fifo*
|
||||
1. c9ec0524 convert sched_setscheduler to sched_set_fifo*
|
||||
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/drbd_wrappers.h drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/drbd_wrappers.h
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/drbd_wrappers.h 2020-10-20 10:48:14.274795598 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/drbd_wrappers.h 2020-10-20 10:48:02.074702666 +0800
|
||||
@@ -523,4 +523,13 @@
|
||||
#define __vmalloc(SIZE, GFP, PRGROT) __vmalloc(SIZE, GFP)
|
||||
#endif
|
||||
|
||||
+#ifndef COMPAT_HAVE_BLK_QUEUE_STACK_LIMITS
|
||||
+#define blk_queue_stack_limits(TOP, BOTTOM) \
|
||||
+ blk_stack_limits(&((TOP)->limits), &((BOTTOM)->limits), 0 )
|
||||
+#endif
|
||||
+
|
||||
+#ifndef COMPAT_HAVE_UNINITIALIZED_VAR
|
||||
+#define uninitialized_var(X) (X)
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_blk_queue_stack_limits.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_blk_queue_stack_limits.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_blk_queue_stack_limits.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_blk_queue_stack_limits.c 2020-10-20 10:48:02.070702635 +0800
|
||||
@@ -0,0 +1,7 @@
|
||||
+#include <linux/blkdev.h>
|
||||
+
|
||||
+/* b9b1a5d7 blk_queue_stack_limits is removed */
|
||||
+void dummy(struct request_queue *a, struct request_queue *b)
|
||||
+{
|
||||
+ blk_queue_stack_limits(a, b);
|
||||
+}
|
||||
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
|
||||
@ -41,20 +11,6 @@ diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_sc
|
||||
+{
|
||||
+ sched_set_fifo_low(p);
|
||||
+}
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_uninitialized_var.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_uninitialized_var.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_uninitialized_var.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_uninitialized_var.c 2020-10-20 10:48:02.070702635 +0800
|
||||
@@ -0,0 +1,10 @@
|
||||
+/* 63a0895d9 uninitialized_var is removed
|
||||
+ * 3f649ab72 uninitialized_var removed in all .c
|
||||
+*/
|
||||
+#include <linux/compiler-gcc.h>
|
||||
+
|
||||
+void test()
|
||||
+{
|
||||
+ unsigned int uninitialized_var(a);
|
||||
+ a = 1;
|
||||
+}
|
||||
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
|
||||
|
@ -1,49 +0,0 @@
|
||||
Upstream ed00aabd5eb9fb44d6aff1173234a2e911b9fead
|
||||
block: rename generic_make_request to submit_bio_noacct
|
||||
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_int.h drbd-9.0.25~0+git.bd41626d/drbd/drbd_int.h
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_int.h 2020-09-19 09:26:23.903673522 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd_int.h 2020-09-19 09:34:03.363139586 +0800
|
||||
@@ -2063,7 +2063,11 @@
|
||||
bio->bi_status = BLK_STS_IOERR;
|
||||
bio_endio(bio);
|
||||
} else {
|
||||
+#ifndef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
+ submit_bio_noacct(bio);
|
||||
+#else
|
||||
generic_make_request(bio);
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_generic_make_request.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_generic_make_request.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_generic_make_request.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_generic_make_request.c 2020-09-19 09:30:31.729550871 +0800
|
||||
@@ -0,0 +1,11 @@
|
||||
+#include <linux/blkdev.h>
|
||||
+
|
||||
+/* in Commit ed00aabd5eb9fb44d6aff1173234a2e911b9fead
|
||||
+ generic_make_request rename to submit_bio_noacct
|
||||
+ */
|
||||
+
|
||||
+void foo(void)
|
||||
+{
|
||||
+ struct bio *bio;
|
||||
+ generic_make_request(bio);
|
||||
+}
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_req.c drbd-9.0.25~0+git.bd41626d/drbd/drbd_req.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_req.c 2020-09-19 09:26:23.903673522 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd_req.c 2020-09-19 09:35:12.107655181 +0800
|
||||
@@ -1481,7 +1481,11 @@
|
||||
} else if (bio_op(bio) == REQ_OP_DISCARD) {
|
||||
drbd_process_discard_or_zeroes_req(req, EE_TRIM);
|
||||
} else {
|
||||
- generic_make_request(bio);
|
||||
+#ifndef COMPAT_HAVE_GENERIC_MAKE_REQUEST
|
||||
+ submit_bio_noacct(bio);
|
||||
+#else
|
||||
+ generic_make_request(bio);
|
||||
+#endif
|
||||
}
|
||||
put_ldev(device);
|
||||
} else {
|
49
compat_get_fs.patch
Normal file
49
compat_get_fs.patch
Normal file
@ -0,0 +1,49 @@
|
||||
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)
|
@ -7,40 +7,12 @@ ion 'kernel_setsockopt'; did you mean 'kernel_getsockname'? [-Werror=implicit-fu
|
||||
[ 13s] | ^~~~~~~~~~~~~~~~~ [ 13s] | kernel_getsockname
|
||||
[ 14s] cc1: some warnings being treated as errors
|
||||
|
||||
diff -Naur drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd-kernel-compat/have_kernel_setsockopt.c drbd-9.0.24~1+git.17730ea3/drbd/drbd-kernel-compat/have_kernel_setsockopt.c
|
||||
--- drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd-kernel-compat/have_kernel_setsockopt.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.24~1+git.17730ea3/drbd/drbd-kernel-compat/have_kernel_setsockopt.c 2020-08-14 10:18:35.107901337 +0800
|
||||
@@ -0,0 +1,13 @@
|
||||
+#include <linux/socket.h>
|
||||
+
|
||||
+/*
|
||||
+ * kernel_setsockopt removed in cb8e59cc
|
||||
+*/
|
||||
+
|
||||
+void test(void)
|
||||
+{
|
||||
+ struct socket *sock;
|
||||
+ int val = 1;
|
||||
+
|
||||
+ (void) kernel_setsockopt(sock, 0, 0, (char *)&val, sizeof(val));
|
||||
+}
|
||||
diff -Naur drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd_transport_tcp.c drbd-9.0.24~1+git.17730ea3/drbd/drbd_transport_tcp.c
|
||||
--- drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd_transport_tcp.c 2020-08-14 10:15:16.122125660 +0800
|
||||
+++ drbd-9.0.24~1+git.17730ea3/drbd/drbd_transport_tcp.c 2020-08-14 10:31:16.930382120 +0800
|
||||
@@ -154,8 +154,12 @@
|
||||
|
||||
static void dtt_nodelay(struct socket *socket)
|
||||
{
|
||||
+#ifdef COMPAT_HAVE_KERNEL_SETSOCKOPT
|
||||
int val = 1;
|
||||
(void) kernel_setsockopt(socket, SOL_TCP, TCP_NODELAY, (char *)&val, sizeof(val));
|
||||
+#else
|
||||
+ tcp_sock_set_nodelay(socket->sk);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static int dtt_init(struct drbd_transport *transport)
|
||||
@@ -889,7 +893,6 @@
|
||||
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;
|
||||
@ -48,11 +20,11 @@ diff -Naur drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd_transport_tcp.c drbd-9.0.24
|
||||
bool ok;
|
||||
|
||||
dsocket = NULL;
|
||||
@@ -1071,9 +1074,14 @@
|
||||
@@ -1065,9 +1064,14 @@
|
||||
dsocket->sk->sk_sndtimeo = timeout;
|
||||
csocket->sk->sk_sndtimeo = timeout;
|
||||
|
||||
+#ifdef COMPAT_HAVE_KERNEL_SETSOCKOPT
|
||||
+#ifndef COMPAT_HAVE_TCP_SOCK_SET_CORK
|
||||
+ int one = 1;
|
||||
err = kernel_setsockopt(dsocket, SOL_SOCKET, SO_KEEPALIVE, (char *)&one, sizeof(one));
|
||||
if (err)
|
||||
@ -63,36 +35,3 @@ diff -Naur drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd_transport_tcp.c drbd-9.0.24
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1213,20 +1221,32 @@
|
||||
|
||||
static void dtt_cork(struct socket *socket)
|
||||
{
|
||||
+#ifdef COMPAT_HAVE_KERNEL_SETSOCKOPT
|
||||
int val = 1;
|
||||
(void) kernel_setsockopt(socket, SOL_TCP, TCP_CORK, (char *)&val, sizeof(val));
|
||||
+#else
|
||||
+ tcp_sock_set_cork(socket->sk, true);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static void dtt_uncork(struct socket *socket)
|
||||
{
|
||||
+#ifdef COMPAT_HAVE_KERNEL_SETSOCKOPT
|
||||
int val = 0;
|
||||
(void) kernel_setsockopt(socket, SOL_TCP, TCP_CORK, (char *)&val, sizeof(val));
|
||||
+#else
|
||||
+ tcp_sock_set_cork(socket->sk, false);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static void dtt_quickack(struct socket *socket)
|
||||
{
|
||||
+#ifdef COMPAT_HAVE_KERNEL_SETSOCKOPT
|
||||
int val = 2;
|
||||
(void) kernel_setsockopt(socket, SOL_TCP, TCP_QUICKACK, (char *)&val, sizeof(val));
|
||||
+#else
|
||||
+ tcp_sock_set_quickack(socket->sk, 2);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static bool dtt_hint(struct drbd_transport *transport, enum drbd_stream stream,
|
||||
|
@ -1,42 +0,0 @@
|
||||
pgprot removed in 88dca4c
|
||||
|
||||
[ 139s] /home/abuild/rpmbuild/BUILD/drbd-9.0.23~1+git.d16bfab7/default/drbd_bitmap.c: In function 'bm_realloc_pages':
|
||||
[ 139s] /home/abuild/rpmbuild/BUILD/drbd-9.0.23~1+git.d16bfab7/default/drbd_bitmap.c:368:15: error: too many arguments to function '__vmalloc'
|
||||
[ 139s] 368 | new_pages = __vmalloc(bytes,
|
||||
[ 139s] | ^~~~~~~~~
|
||||
[ 139s] In file included from /home/abuild/rpmbuild/BUILD/drbd-9.0.23~1+git.d16bfab7/default/drbd_bitmap.c:16:
|
||||
[ 139s] /usr/src/linux-5.8.0-1/include/linux/vmalloc.h:111:14: note: declared here
|
||||
[ 139s] 111 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
|
||||
[ 139s] | ^~~~~~~~~
|
||||
|
||||
diff -Naur drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd-kernel-compat/drbd_wrappers.h drbd-9.0.24~1+git.17730ea3/drbd/drbd-kernel-compat/drbd_wrappers.h
|
||||
--- drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd-kernel-compat/drbd_wrappers.h 2020-08-13 14:22:17.895201728 +0800
|
||||
+++ drbd-9.0.24~1+git.17730ea3/drbd/drbd-kernel-compat/drbd_wrappers.h 2020-08-13 14:33:13.168276614 +0800
|
||||
@@ -521,4 +521,8 @@
|
||||
void arch_wb_cache_pmem(void *addr, size_t size);
|
||||
#endif
|
||||
|
||||
+#ifndef COMPAT_HAVE_VMALLOC_NO_PGPROT
|
||||
+#define __vmalloc(SIZE, GFP, PRGROT) __vmalloc(SIZE, GFP)
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
diff -Naur drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd-kernel-compat/tests/have_vmalloc_no_pgprot.c drbd-9.0.24~1+git.17730ea3/drbd/drbd-kernel-compat/tests/have_vmalloc_no_pgprot.c
|
||||
--- drbd-9.0.24~1+git.17730ea3.orig/drbd/drbd-kernel-compat/tests/have_vmalloc_no_pgprot.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.24~1+git.17730ea3/drbd/drbd-kernel-compat/tests/have_vmalloc_no_pgprot.c 2020-08-13 14:29:04.930365926 +0800
|
||||
@@ -0,0 +1,15 @@
|
||||
+/*
|
||||
+ * Because RHEL 7.5 chose to provide refcount.h, but not use it, we don't
|
||||
+ * directly include refcount.h, but rely on the implicit include via kref.h,
|
||||
+ * This way, we avoid compile time warnings about atomic_t != refcount_t.
|
||||
+ */
|
||||
+#include <linux/vmalloc.h>
|
||||
+
|
||||
+/*
|
||||
+ * extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
|
||||
+ * 88dca4c mm: remove the pgprot argument to __vmalloc
|
||||
+*/
|
||||
+void test(unsigned long bytes)
|
||||
+{
|
||||
+ __vmalloc(bytes, GFP_NOIO | __GFP_ZERO);
|
||||
+}
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a2caec13ee4d3936ebf296a8d52c17197a6c90c4504e6c2c066a844f630ef355
|
||||
size 355097
|
3
drbd-9.0.26~0+git.9114a038.tar.bz2
Normal file
3
drbd-9.0.26~0+git.9114a038.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e25e22596e35dc77e2a448f4ef81b804256ca781676a6e44a54876e6bee5c2f5
|
||||
size 359845
|
53
drbd.changes
53
drbd.changes
@ -1,3 +1,56 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 9 06:40:33 UTC 2020 - nick wang <nwang@suse.com>
|
||||
|
||||
- bsc#1179708, compat to kernel v5.10
|
||||
- Add patch compat_get_fs.patch
|
||||
Add patch remove_bdi_cap_stable_writes.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 8 09:23:06 UTC 2020 - nick wang <nwang@suse.com>
|
||||
|
||||
- Update to 9.0.26
|
||||
* fix a case of a disk unexpectedly becoming Outdated by moving the
|
||||
exchange of the initial packets into the body of the two-phase-commit
|
||||
that happens at a connect
|
||||
* fix adding of new volumes to resources with a primary node
|
||||
* reliably detect split brain situation on both nodes
|
||||
* fix an unexpected occurrence of NetworkFailure state in a tight
|
||||
drbdsetup disconnect; drbdsetup connect sequence
|
||||
* fix online verify to return to Established from VerifyS if the VerifyT node
|
||||
was temporarily Inconsistent during the run
|
||||
* fix a corner case where a node ends up Outdated after the crash and rejoin
|
||||
of a primary node
|
||||
* implement 'blockdev --setro' in DRBD
|
||||
* following upstream changes to DRBD up to Linux 5.9 and ensure
|
||||
compatibility with Linux 5.8 and 5.9
|
||||
* fix a crash if during resync a discard operation fails on the
|
||||
resync-target node
|
||||
* fix online verify to not clamp disk states to UpToDate
|
||||
* fix promoting resync-target nodes; the problem was that it could modify
|
||||
the bitmap of an ongoing resync; which leads to alarming log messages
|
||||
* pause a resync if the sync-source node becomes inconsistent; an example
|
||||
is a cascading resync where the upstream resync aborts and leaves the
|
||||
sync-source node for the downstream resync with an inconsistent disk;
|
||||
note, the node at the end of the chain could still have an outdated disk
|
||||
(better than inconsistent)
|
||||
* allow force primary on a sync-target node by breaking the resync
|
||||
* minor fixes to the compat tests
|
||||
* fix for writes not getting mirrored over a connection while the primary
|
||||
transitions through the WFBitMapS state
|
||||
* completed missing logic of the new two-phase-commit based connect process;
|
||||
avoid connecting partitions with a primary in each; ensure consistent
|
||||
decisions if the connect attempt will be retried
|
||||
- Add patch compat-test-header.patch
|
||||
Add patch submit-bio-private-date.patch
|
||||
- Remove patch rely-on-sb-handlers.patch (187bddac0)
|
||||
Remove patch fix-err-of-wrong-return-type.patch (969310232)
|
||||
Remove patch compat_remove_pgprot_88dca4c.patch (ee025dc84)
|
||||
Remove patch compat_generic_make_request.patch (8615d6837)
|
||||
Remove patch blk_alloc_queue_make_request.patch (edaa9b0f/fb59b40e)
|
||||
Remove patch remove_congested_fn_congested_data.patch (34484003/9b80d46b)
|
||||
- Modify patch compat_remove_kernel_setsockopt.patch (518846b54)
|
||||
Modify patch compat_blk_queue_stack_limits.patch (edaa9b0f2)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 3 11:21:13 UTC 2020 - nick wang <nwang@suse.com>
|
||||
|
||||
|
24
drbd.spec
24
drbd.spec
@ -24,7 +24,7 @@
|
||||
%endif
|
||||
%endif
|
||||
Name: drbd
|
||||
Version: 9.0.25~0+git.bd41626d
|
||||
Version: 9.0.26~0+git.9114a038
|
||||
Release: 0
|
||||
Summary: Linux driver for the "Distributed Replicated Block Device"
|
||||
License: GPL-2.0-or-later
|
||||
@ -35,17 +35,17 @@ Source1: preamble
|
||||
Source2: Module.supported
|
||||
Source3: drbd_git_revision
|
||||
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: compat_remove_pgprot_88dca4c.patch
|
||||
Patch5: compat_remove_include_vermagic.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
|
||||
# Compat to kernel v5.9
|
||||
Patch7: compat_generic_make_request.patch
|
||||
Patch8: blk_alloc_queue_make_request.patch
|
||||
Patch9: remove_congested_fn_congested_data.patch
|
||||
Patch10: compat_blk_queue_stack_limits.patch
|
||||
Patch11: fix-err-of-wrong-return-type.patch
|
||||
Patch7: compat_blk_queue_stack_limits.patch
|
||||
#compat to v5.10
|
||||
Patch8: remove_bdi_cap_stable_writes.patch
|
||||
Patch9: compat_get_fs.patch
|
||||
Patch99: suse-coccinelle.patch
|
||||
#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py
|
||||
BuildRequires: coccinelle >= 1.0.8
|
||||
@ -88,8 +88,6 @@ installed kernel.
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch99 -p1
|
||||
|
||||
mkdir source
|
||||
|
@ -1 +1 @@
|
||||
GIT-hash: bd41626d3fdc7b6f575532020ff9ce1c9c4bf29b
|
||||
GIT-hash: 9114a0383f72b87610cd9ee282676cf94213da5b
|
||||
|
@ -1,11 +0,0 @@
|
||||
diff -Naur drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/tests/have_blk_qc_t_make_request.c drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/tests/have_blk_qc_t_make_request.c
|
||||
--- drbd-9.0.16+git.ab9777df.orig/drbd/drbd-kernel-compat/tests/have_blk_qc_t_make_request.c 2020-11-03 17:45:49.362231056 +0800
|
||||
+++ drbd-9.0.16+git.ab9777df/drbd/drbd-kernel-compat/tests/have_blk_qc_t_make_request.c 2020-11-03 19:11:54.843913135 +0800
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio)
|
||||
{
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
#ifndef __same_type
|
@ -1,45 +0,0 @@
|
||||
diff -Naur drbd-9.0.11+git.1e2bccdc.orig/drbd/drbd_state.c drbd-9.0.11+git.1e2bccdc/drbd/drbd_state.c
|
||||
--- drbd-9.0.11+git.1e2bccdc.orig/drbd/drbd_state.c 2019-08-27 13:34:08.462567903 +0800
|
||||
+++ drbd-9.0.11+git.1e2bccdc/drbd/drbd_state.c 2019-08-30 12:56:37.664186710 +0800
|
||||
@@ -1398,8 +1398,13 @@
|
||||
nc = rcu_dereference(connection->transport.net_conf);
|
||||
two_primaries = nc ? nc->two_primaries : false;
|
||||
if (peer_role[NEW] == R_PRIMARY && peer_role[OLD] != R_PRIMARY && !two_primaries) {
|
||||
- if (role[NOW] == R_PRIMARY)
|
||||
- return SS_TWO_PRIMARIES;
|
||||
+ if (role[NOW] == R_PRIMARY) {
|
||||
+ if (role[OLD] == R_PRIMARY && connection->cstate[OLD] < C_CONNECTED) {
|
||||
+ drbd_info(connection, "Two primaries but not allowed. Rely on split brain handler or to disconnect.\n");
|
||||
+ } else {
|
||||
+ return SS_TWO_PRIMARIES;
|
||||
+ }
|
||||
+ }
|
||||
idr_for_each_entry(&resource->devices, device, vnr) {
|
||||
if (device->open_ro_cnt)
|
||||
return SS_PRIMARY_READER;
|
||||
@@ -3665,7 +3670,11 @@
|
||||
mask = NODE_MASK(connection->peer_node_id);
|
||||
if ((resource->twopc_reply.primary_nodes & mask) &&
|
||||
!(connection->transport.net_conf->two_primaries)) {
|
||||
- rv = SS_TWO_PRIMARIES;
|
||||
+ if (connection->cstate[OLD] < C_CONNECTED && connection->cstate[NEW] == C_CONNECTED) {
|
||||
+ drbd_info(connection, "Two primaries but not allowed after reconnected. Rely on split brain handler or to disconnect.\n");
|
||||
+ } else {
|
||||
+ rv = SS_TWO_PRIMARIES;
|
||||
+ }
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3739,7 +3748,11 @@
|
||||
nc = rcu_dereference(connection->transport.net_conf);
|
||||
if (!nc->two_primaries &&
|
||||
NODE_MASK(connection->peer_node_id) & reply->primary_nodes) {
|
||||
- rv = SS_PRIMARY_READER;
|
||||
+ if (connection->cstate[OLD] < C_CONNECTED && connection->cstate[NEW] == C_CONNECTED) {
|
||||
+ drbd_info(connection, "Two primaries and device is opened as read only. Rely on split brain handler or to disconnect.\n");
|
||||
+ } else {
|
||||
+ rv = SS_PRIMARY_READER;
|
||||
+ }
|
||||
break;
|
||||
}
|
||||
}
|
22
remove_bdi_cap_stable_writes.patch
Normal file
22
remove_bdi_cap_stable_writes.patch
Normal file
@ -0,0 +1,22 @@
|
||||
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)
|
@ -1,115 +0,0 @@
|
||||
1. Remove congested_fn and drbd_congested due to
|
||||
21cf866145047f8bfecb38ec8d2fed64464c074f
|
||||
2. Change define of blkdev_get_by_path from fs.h to blkdev.h,
|
||||
3f1266f1f82d7b8c72472a8921e80aa3e611fb62
|
||||
3. Change define of bd_unlink_disk_holder from fs.h to genhd.h,
|
||||
3f1266f1f82d7b8c72472a8921e80aa3e611fb62
|
||||
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/drbd_wrappers.h drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/drbd_wrappers.h
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/drbd_wrappers.h 2020-10-10 10:50:15.408562371 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/drbd_wrappers.h 2020-10-10 10:50:21.156601464 +0800
|
||||
@@ -143,9 +143,7 @@
|
||||
|
||||
#ifdef COMPAT_HAVE_POINTER_BACKING_DEV_INFO /* >= v4.11 */
|
||||
#define bdi_from_device(device) (device->ldev->backing_bdev->bd_disk->queue->backing_dev_info)
|
||||
-#define init_bdev_info(bdev_info, drbd_congested, device) do { \
|
||||
- (bdev_info)->congested_fn = drbd_congested; \
|
||||
- (bdev_info)->congested_data = device; \
|
||||
+#define init_bdev_info(bdev_info, device) do { \
|
||||
set_bdi_cap_stable_writes(bdev_info->capabilities); \
|
||||
} while(0)
|
||||
#define adjust_ra_pages(q, b) _adjust_ra_pages((q)->backing_dev_info->ra_pages, (b)->backing_dev_info->ra_pages)
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c 2020-10-10 10:50:15.408562371 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c 2020-10-10 10:50:29.488658135 +0800
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <linux/fs.h>
|
||||
+#include <linux/genhd.h>
|
||||
|
||||
#ifdef CONFIG_SYSFS
|
||||
void dummy(struct block_device *bdev, struct gendisk *disk)
|
||||
diff -Naur drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_blkdev_get_by_path.c drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_blkdev_get_by_path.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd-kernel-compat/tests/have_blkdev_get_by_path.c 2020-10-10 10:50:15.408562371 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd-kernel-compat/tests/have_blkdev_get_by_path.c 2020-10-10 10:50:40.432732559 +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.25~0+git.bd41626d.orig/drbd/drbd_main.c drbd-9.0.25~0+git.bd41626d/drbd/drbd_main.c
|
||||
--- drbd-9.0.25~0+git.bd41626d.orig/drbd/drbd_main.c 2020-10-10 10:50:15.412562399 +0800
|
||||
+++ drbd-9.0.25~0+git.bd41626d/drbd/drbd_main.c 2020-10-10 10:50:21.156601464 +0800
|
||||
@@ -3103,63 +3103,6 @@
|
||||
pr_info("module cleanup done.\n");
|
||||
}
|
||||
|
||||
-/**
|
||||
- * drbd_congested() - Callback for the flusher thread
|
||||
- * @congested_data: User data
|
||||
- * @bdi_bits: Bits the BDI flusher thread is currently interested in
|
||||
- *
|
||||
- * Returns 1<<WB_async_congested and/or 1<<WB_sync_congested if we are congested.
|
||||
- */
|
||||
-static int drbd_congested(void *congested_data, int bdi_bits)
|
||||
-{
|
||||
- struct drbd_device *device = congested_data;
|
||||
- struct request_queue *q;
|
||||
- int r = 0;
|
||||
-
|
||||
- if (!may_inc_ap_bio(device)) {
|
||||
- /* DRBD has frozen IO */
|
||||
- r = bdi_bits;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- if (test_bit(CALLBACK_PENDING, &device->resource->flags)) {
|
||||
- r |= (1 << WB_async_congested);
|
||||
- /* Without good local data, we would need to read from remote,
|
||||
- * and that would need the worker thread as well, which is
|
||||
- * currently blocked waiting for that usermode helper to
|
||||
- * finish.
|
||||
- */
|
||||
- if (!get_ldev_if_state(device, D_UP_TO_DATE))
|
||||
- r |= (1 << WB_sync_congested);
|
||||
- else
|
||||
- put_ldev(device);
|
||||
- r &= bdi_bits;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- if (get_ldev(device)) {
|
||||
- q = bdev_get_queue(device->ldev->backing_bdev);
|
||||
- r = bdi_congested(q->backing_dev_info, bdi_bits);
|
||||
- put_ldev(device);
|
||||
- }
|
||||
-
|
||||
- if (bdi_bits & (1 << WB_async_congested)) {
|
||||
- struct drbd_peer_device *peer_device;
|
||||
-
|
||||
- rcu_read_lock();
|
||||
- for_each_peer_device_rcu(peer_device, device) {
|
||||
- if (test_bit(NET_CONGESTED, &peer_device->connection->transport.flags)) {
|
||||
- r |= (1 << WB_async_congested);
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
- rcu_read_unlock();
|
||||
- }
|
||||
-
|
||||
-out:
|
||||
- return r;
|
||||
-}
|
||||
-
|
||||
static void drbd_init_workqueue(struct drbd_work_queue* wq)
|
||||
{
|
||||
spin_lock_init(&wq->q_lock);
|
||||
@@ -3731,7 +3674,7 @@
|
||||
/* we have no partitions. we contain only ourselves. */
|
||||
device->this_bdev->bd_contains = device->this_bdev;
|
||||
|
||||
- init_bdev_info(q->backing_dev_info, drbd_congested, device);
|
||||
+ init_bdev_info(q->backing_dev_info, device);
|
||||
|
||||
blk_queue_write_cache(q, true, true);
|
||||
|
23
submit-bio-private-date.patch
Normal file
23
submit-bio-private-date.patch
Normal file
@ -0,0 +1,23 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user