Accepting request 1127654 from home:gsu:branches:network:ha-clustering:Factory
- drbd: fix build error against kernel v6.6.1 (boo#1217078) * add upstream patches + 0021-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch + 0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch + 0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch * remove patch which are already included in upstream patches: - bsc-1215699_fix-build-error-against-kernel-v6.5.4.patch OBS-URL: https://build.opensuse.org/request/show/1127654 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=147
This commit is contained in:
parent
e7b40eeaea
commit
172292f7b4
107
0021-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch
Normal file
107
0021-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch
Normal file
@ -0,0 +1,107 @@
|
||||
From a000a5577210929ca808fe19719186cb7e917f44 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Moritz=20WanzenBug=20Wanzenb=C3=B6ck?=
|
||||
<moritz.wanzenboeck@linbit.com>
|
||||
Date: Wed, 13 Sep 2023 13:30:57 +0200
|
||||
Subject: [PATCH] compat: sock: Remove ->sendpage*() in favour of
|
||||
sendmsg(MSG_SPLICE_PAGES)
|
||||
|
||||
See also upstream Linux kernel commits
|
||||
dc97391e6610 ("sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES)")
|
||||
eeac7405c735 ("drbd: Use sendmsg(MSG_SPLICE_PAGES) rather than sendpage()")
|
||||
4b9c2edaf728 ("drbd: swap bvec_set_page len and offset")
|
||||
|
||||
Original message:
|
||||
|
||||
Remove ->sendpage() and ->sendpage_locked(). sendmsg() with
|
||||
MSG_SPLICE_PAGES should be used instead. This allows multiple pages and
|
||||
multipage folios to be passed through.
|
||||
---
|
||||
.../cocci/msg_splice_pages__no_present.cocci | 16 ++++++++++++++++
|
||||
drbd/drbd-kernel-compat/gen_patch_names.c | 3 +++
|
||||
.../tests/have_msg_splice_pages.c | 7 +++++++
|
||||
drbd/drbd_transport_tcp.c | 8 ++++++--
|
||||
4 files changed, 32 insertions(+), 2 deletions(-)
|
||||
create mode 100644 drbd/drbd-kernel-compat/cocci/msg_splice_pages__no_present.cocci
|
||||
create mode 100644 drbd/drbd-kernel-compat/tests/have_msg_splice_pages.c
|
||||
|
||||
diff --git a/drbd/drbd-kernel-compat/cocci/msg_splice_pages__no_present.cocci b/drbd/drbd-kernel-compat/cocci/msg_splice_pages__no_present.cocci
|
||||
new file mode 100644
|
||||
index 000000000000..0fdf77e43737
|
||||
--- /dev/null
|
||||
+++ b/drbd/drbd-kernel-compat/cocci/msg_splice_pages__no_present.cocci
|
||||
@@ -0,0 +1,16 @@
|
||||
+@@
|
||||
+expression flags;
|
||||
+@@
|
||||
+ flags
|
||||
+- | MSG_SPLICE_PAGES
|
||||
+
|
||||
+@@
|
||||
+identifier bvec, page, len, offset, msg, socket;
|
||||
+@@
|
||||
+- struct bio_vec bvec;
|
||||
+ ...
|
||||
+ int sent;
|
||||
+- bvec_set_page(&bvec, page, len, offset);
|
||||
+- iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, len);
|
||||
+- sent = sock_sendmsg(socket, &msg);
|
||||
++ sent = socket->ops->sendpage(socket, page, offset, len, msg.msg_flags);
|
||||
diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
index 608be8b4f099..6a96c5b89f11 100644
|
||||
--- a/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
+++ b/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
@@ -127,6 +127,9 @@ int main(int argc, char **argv)
|
||||
patch(1, "bvec_kmap_local", true, false,
|
||||
COMPAT_HAVE_BVEC_KMAP_LOCAL, "present");
|
||||
|
||||
+ patch(1, "msg_splice_pages", true, false,
|
||||
+ COMPAT_HAVE_MSG_SPLICE_PAGES, "present");
|
||||
+
|
||||
patch(1, "struct_bvec_iter", true, false,
|
||||
COMPAT_HAVE_STRUCT_BVEC_ITER, "present");
|
||||
|
||||
diff --git a/drbd/drbd-kernel-compat/tests/have_msg_splice_pages.c b/drbd/drbd-kernel-compat/tests/have_msg_splice_pages.c
|
||||
new file mode 100644
|
||||
index 000000000000..0bb23ef6d39a
|
||||
--- /dev/null
|
||||
+++ b/drbd/drbd-kernel-compat/tests/have_msg_splice_pages.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+/* { "version": "v6.5-rc1", "commit": "dc97391e661009eab46783030d2404c9b6e6f2e7", "comment": "sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES)", "author": "David Howells <dhowells@redhat.com>", "date": "Fri Jun 23 23:55:12 2023 +0100" } */
|
||||
+#include <linux/net.h>
|
||||
+
|
||||
+int foo(void)
|
||||
+{
|
||||
+ return MSG_SPLICE_PAGES;
|
||||
+}
|
||||
diff --git a/drbd/drbd_transport_tcp.c b/drbd/drbd_transport_tcp.c
|
||||
index ca60833f73d7..5dcba50dd0eb 100644
|
||||
--- a/drbd/drbd_transport_tcp.c
|
||||
+++ b/drbd/drbd_transport_tcp.c
|
||||
@@ -1193,18 +1193,22 @@ static int dtt_send_page(struct drbd_transport *transport, enum drbd_stream stre
|
||||
struct drbd_tcp_transport *tcp_transport =
|
||||
container_of(transport, struct drbd_tcp_transport, transport);
|
||||
struct socket *socket = tcp_transport->stream[stream];
|
||||
+ struct msghdr msg = { .msg_flags = msg_flags | MSG_NOSIGNAL | MSG_SPLICE_PAGES };
|
||||
+ struct bio_vec bvec;
|
||||
int len = size;
|
||||
int err = -EIO;
|
||||
|
||||
if (!socket)
|
||||
return -ENOTCONN;
|
||||
|
||||
- msg_flags |= MSG_NOSIGNAL;
|
||||
dtt_update_congested(tcp_transport);
|
||||
do {
|
||||
int sent;
|
||||
|
||||
- sent = socket->ops->sendpage(socket, page, offset, len, msg_flags);
|
||||
+ bvec_set_page(&bvec, page, len, offset);
|
||||
+ iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, len);
|
||||
+
|
||||
+ sent = sock_sendmsg(socket, &msg);
|
||||
if (sent <= 0) {
|
||||
if (sent == -EAGAIN) {
|
||||
if (drbd_stream_send_timed_out(transport, stream))
|
||||
--
|
||||
2.42.1
|
||||
|
183
0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch
Normal file
183
0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch
Normal file
@ -0,0 +1,183 @@
|
||||
From 2d3c3fd6546174a0452c9bbd64d4f4193c0c39e2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Moritz=20WanzenBug=20Wanzenb=C3=B6ck?=
|
||||
<moritz.wanzenboeck@linbit.com>
|
||||
Date: Wed, 13 Sep 2023 11:26:35 +0200
|
||||
Subject: [PATCH] compat: block: replace fmode_t with a block-specific type for
|
||||
block open flags
|
||||
|
||||
See also upstream Linux kernel commit
|
||||
05bdb9965305 ("block: replace fmode_t with a block-specific type for block open flags"
|
||||
|
||||
Original message:
|
||||
|
||||
The only overlap between the block open flags mapped into the fmode_t and
|
||||
other uses of fmode_t are FMODE_READ and FMODE_WRITE. Define a new
|
||||
blk_mode_t instead for use in blkdev_get_by_{dev,path}, ->open and
|
||||
->ioctl and stop abusing fmode_t.
|
||||
---
|
||||
.../cocci/blk_mode_t__no_present.cocci | 19 ++++++++++++++
|
||||
drbd/drbd-kernel-compat/gen_patch_names.c | 3 +++
|
||||
.../tests/have_blk_mode_t.c | 4 +++
|
||||
drbd/drbd_main.c | 26 +++++++++----------
|
||||
4 files changed, 39 insertions(+), 13 deletions(-)
|
||||
create mode 100644 drbd/drbd-kernel-compat/cocci/blk_mode_t__no_present.cocci
|
||||
create mode 100644 drbd/drbd-kernel-compat/tests/have_blk_mode_t.c
|
||||
|
||||
diff --git a/drbd/drbd-kernel-compat/cocci/blk_mode_t__no_present.cocci b/drbd/drbd-kernel-compat/cocci/blk_mode_t__no_present.cocci
|
||||
new file mode 100644
|
||||
index 000000000000..030723c817de
|
||||
--- /dev/null
|
||||
+++ b/drbd/drbd-kernel-compat/cocci/blk_mode_t__no_present.cocci
|
||||
@@ -0,0 +1,19 @@
|
||||
+@@
|
||||
+identifier fn;
|
||||
+identifier mode;
|
||||
+@@
|
||||
+ fn (
|
||||
+ ...,
|
||||
+- blk_mode_t mode
|
||||
++ fmode_t mode
|
||||
+ ) {
|
||||
+ <...
|
||||
+(
|
||||
+- BLK_OPEN_WRITE
|
||||
++ FMODE_WRITE
|
||||
+|
|
||||
+- BLK_OPEN_NDELAY
|
||||
++ FMODE_NDELAY
|
||||
+)
|
||||
+ ...>
|
||||
+ }
|
||||
diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
index 6a96c5b89f11..e4a65a3c451e 100644
|
||||
--- a/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
+++ b/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
@@ -571,6 +571,9 @@ int main(int argc, char **argv)
|
||||
patch(1, "block_device_operations_release", true, false,
|
||||
COMPAT_BLOCK_DEVICE_OPERATIONS_RELEASE_TAKES_SINGLE_ARGUMENT, "takes_single_argument");
|
||||
|
||||
+ patch(1, "blk_mode_t", true, false,
|
||||
+ COMPAT_HAVE_BLK_MODE_T, "present");
|
||||
+
|
||||
/* #define BLKDEV_ISSUE_ZEROOUT_EXPORTED */
|
||||
/* #define BLKDEV_ZERO_NOUNMAP */
|
||||
|
||||
diff --git a/drbd/drbd-kernel-compat/tests/have_blk_mode_t.c b/drbd/drbd-kernel-compat/tests/have_blk_mode_t.c
|
||||
new file mode 100644
|
||||
index 000000000000..e063bdc30f43
|
||||
--- /dev/null
|
||||
+++ b/drbd/drbd-kernel-compat/tests/have_blk_mode_t.c
|
||||
@@ -0,0 +1,4 @@
|
||||
+/* { "version": "v6.5-rc1", "commit": "05bdb9965305bbfdae79b31d22df03d1e2cfcb22", "comment": "block: replace fmode_t with a block-specific type for block open flags", "author": "Christoph Hellwig <hch@lst.de>", "date": "Thu Jun 8 13:02:55 2023 +0200" } */
|
||||
+#include <linux/blkdev.h>
|
||||
+
|
||||
+void foo(blk_mode_t mode) {}
|
||||
diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c
|
||||
index 0719229f210e..f9560bdff63f 100644
|
||||
--- a/drbd/drbd_main.c
|
||||
+++ b/drbd/drbd_main.c
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "drbd_meta_data.h"
|
||||
#include "drbd_dax_pmem.h"
|
||||
|
||||
-static int drbd_open(struct gendisk *gd, fmode_t mode);
|
||||
+static int drbd_open(struct gendisk *gd, blk_mode_t mode);
|
||||
static void drbd_release(struct gendisk *gd);
|
||||
static void md_sync_timer_fn(struct timer_list *t);
|
||||
static int w_bitmap_io(struct drbd_work *w, int unused);
|
||||
@@ -2566,10 +2566,10 @@ enum ioc_rv {
|
||||
IOC_ABORT = 2,
|
||||
};
|
||||
|
||||
-static enum ioc_rv inc_open_count(struct drbd_device *device, fmode_t mode)
|
||||
+static enum ioc_rv inc_open_count(struct drbd_device *device, blk_mode_t mode)
|
||||
{
|
||||
struct drbd_resource *resource = device->resource;
|
||||
- enum ioc_rv r = mode & FMODE_NDELAY ? IOC_ABORT : IOC_SLEEP;
|
||||
+ enum ioc_rv r = mode & BLK_OPEN_NDELAY ? IOC_ABORT : IOC_SLEEP;
|
||||
|
||||
if (test_bit(DOWN_IN_PROGRESS, &resource->flags))
|
||||
return IOC_ABORT;
|
||||
@@ -2580,7 +2580,7 @@ static enum ioc_rv inc_open_count(struct drbd_device *device, fmode_t mode)
|
||||
else if (!resource->remote_state_change) {
|
||||
r = IOC_OK;
|
||||
device->open_cnt++;
|
||||
- if (mode & FMODE_WRITE)
|
||||
+ if (mode & BLK_OPEN_WRITE)
|
||||
device->writable = true;
|
||||
}
|
||||
read_unlock_irq(&resource->state_rwlock);
|
||||
@@ -2646,7 +2646,7 @@ out:
|
||||
spin_unlock(&device->openers_lock);
|
||||
}
|
||||
|
||||
-static int drbd_open(struct gendisk *gd, fmode_t mode)
|
||||
+static int drbd_open(struct gendisk *gd, blk_mode_t mode)
|
||||
{
|
||||
struct drbd_device *device = gd->private_data;
|
||||
struct drbd_resource *resource = device->resource;
|
||||
@@ -2655,7 +2655,7 @@ static int drbd_open(struct gendisk *gd, fmode_t mode)
|
||||
int err = 0;
|
||||
|
||||
/* Fail read-only open from systemd-udev (version <= 238) */
|
||||
- if (!(mode & FMODE_WRITE) && !drbd_allow_oos) {
|
||||
+ if (!(mode & BLK_OPEN_WRITE) && !drbd_allow_oos) {
|
||||
char comm[TASK_COMM_LEN];
|
||||
get_task_comm(comm, current);
|
||||
if (!strcmp("systemd-udevd", comm))
|
||||
@@ -2664,7 +2664,7 @@ static int drbd_open(struct gendisk *gd, fmode_t mode)
|
||||
|
||||
/* Fail read-write open early,
|
||||
* in case someone explicitly set us read-only (blockdev --setro) */
|
||||
- if (bdev_read_only(gd->part0) && (mode & FMODE_WRITE))
|
||||
+ if (bdev_read_only(gd->part0) && (mode & BLK_OPEN_WRITE))
|
||||
return -EACCES;
|
||||
|
||||
if (resource->fail_io[NOW])
|
||||
@@ -2693,14 +2693,14 @@ static int drbd_open(struct gendisk *gd, fmode_t mode)
|
||||
This avoids split brain when the drbd volume gets opened
|
||||
temporarily by udev while it scans for PV signatures. */
|
||||
|
||||
- if (mode & FMODE_WRITE) {
|
||||
+ if (mode & BLK_OPEN_WRITE) {
|
||||
if (resource->role[NOW] == R_SECONDARY) {
|
||||
- rv = try_to_promote(device, timeout, (mode & FMODE_NDELAY));
|
||||
+ rv = try_to_promote(device, timeout, (mode & BLK_OPEN_NDELAY));
|
||||
if (rv < SS_SUCCESS)
|
||||
drbd_info(resource, "Auto-promote failed: %s (%d)\n",
|
||||
drbd_set_st_err_str(rv), rv);
|
||||
}
|
||||
- } else if ((mode & FMODE_NDELAY) == 0) {
|
||||
+ } else if ((mode & BLK_OPEN_NDELAY) == 0) {
|
||||
/* Double check peers
|
||||
*
|
||||
* Some services may try to first open ro, and only if that
|
||||
@@ -2720,14 +2720,14 @@ static int drbd_open(struct gendisk *gd, fmode_t mode)
|
||||
}
|
||||
}
|
||||
} else if (resource->role[NOW] != R_PRIMARY &&
|
||||
- !(mode & FMODE_WRITE) && !drbd_allow_oos) {
|
||||
+ !(mode & BLK_OPEN_WRITE) && !drbd_allow_oos) {
|
||||
err = -EMEDIUMTYPE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (test_bit(UNREGISTERED, &device->flags)) {
|
||||
err = -ENODEV;
|
||||
- } else if (mode & FMODE_WRITE) {
|
||||
+ } else if (mode & BLK_OPEN_WRITE) {
|
||||
if (resource->role[NOW] != R_PRIMARY)
|
||||
err = -EROFS;
|
||||
} else /* READ access only */ {
|
||||
@@ -2741,7 +2741,7 @@ out:
|
||||
mutex_unlock(&resource->open_release);
|
||||
if (err) {
|
||||
drbd_release(gd);
|
||||
- if (err == -EAGAIN && !(mode & FMODE_NDELAY))
|
||||
+ if (err == -EAGAIN && !(mode & BLK_OPEN_NDELAY))
|
||||
err = -EMEDIUMTYPE;
|
||||
}
|
||||
|
||||
--
|
||||
2.42.1
|
||||
|
@ -0,0 +1,96 @@
|
||||
From 1412792a443ddc696fd1c8981a6cc544272f54bf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Moritz=20WanzenBug=20Wanzenb=C3=B6ck?=
|
||||
<moritz.wanzenboeck@linbit.com>
|
||||
Date: Wed, 13 Sep 2023 15:46:12 +0200
|
||||
Subject: [PATCH] compat: genetlink: remove userhdr from struct genl_info
|
||||
|
||||
See also upstream Linux kernel commit
|
||||
bffcc6882a1b ("genetlink: remove userhdr from struct genl_info")
|
||||
|
||||
Original message:
|
||||
|
||||
Only three families use info->userhdr today and going forward
|
||||
we discourage using fixed headers in new families.
|
||||
So having the pointer to user header in struct genl_info
|
||||
is an overkill. Compute the header pointer at runtime.
|
||||
---
|
||||
.../cocci/genl_info_userhdr__no_present.cocci | 5 +++++
|
||||
drbd/drbd-kernel-compat/gen_patch_names.c | 3 +++
|
||||
drbd/drbd-kernel-compat/tests/have_genl_info_userhdr.c | 7 +++++++
|
||||
drbd/drbd_nl.c | 6 +++---
|
||||
4 files changed, 18 insertions(+), 3 deletions(-)
|
||||
create mode 100644 drbd/drbd-kernel-compat/cocci/genl_info_userhdr__no_present.cocci
|
||||
create mode 100644 drbd/drbd-kernel-compat/tests/have_genl_info_userhdr.c
|
||||
|
||||
diff --git a/drbd/drbd-kernel-compat/cocci/genl_info_userhdr__no_present.cocci b/drbd/drbd-kernel-compat/cocci/genl_info_userhdr__no_present.cocci
|
||||
new file mode 100644
|
||||
index 000000000000..75e787797068
|
||||
--- /dev/null
|
||||
+++ b/drbd/drbd-kernel-compat/cocci/genl_info_userhdr__no_present.cocci
|
||||
@@ -0,0 +1,5 @@
|
||||
+@@
|
||||
+expression info;
|
||||
+@@
|
||||
+- genl_info_userhdr(info)
|
||||
++ info->userhdr
|
||||
diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
index e4a65a3c451e..b136acf3148a 100644
|
||||
--- a/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
+++ b/drbd/drbd-kernel-compat/gen_patch_names.c
|
||||
@@ -574,6 +574,9 @@ int main(int argc, char **argv)
|
||||
patch(1, "blk_mode_t", true, false,
|
||||
COMPAT_HAVE_BLK_MODE_T, "present");
|
||||
|
||||
+ patch(1, "genl_info_userhdr", true, false,
|
||||
+ COMPAT_HAVE_GENL_INFO_USERHDR, "present");
|
||||
+
|
||||
/* #define BLKDEV_ISSUE_ZEROOUT_EXPORTED */
|
||||
/* #define BLKDEV_ZERO_NOUNMAP */
|
||||
|
||||
diff --git a/drbd/drbd-kernel-compat/tests/have_genl_info_userhdr.c b/drbd/drbd-kernel-compat/tests/have_genl_info_userhdr.c
|
||||
new file mode 100644
|
||||
index 000000000000..3c69dacce244
|
||||
--- /dev/null
|
||||
+++ b/drbd/drbd-kernel-compat/tests/have_genl_info_userhdr.c
|
||||
@@ -0,0 +1,7 @@
|
||||
+/* { "version": "v6.6-rc1", "commit": "bffcc6882a1bb2be8c9420184966f4c2c822078e", "comment": "genetlink: remove userhdr from struct genl_info", "author": "Jakub Kicinski <kuba@kernel.org>", "date": "Mon Aug 14 14:47:16 2023 -0700" } */
|
||||
+#include <net/genetlink.h>
|
||||
+
|
||||
+void *foo(struct genl_info *info)
|
||||
+{
|
||||
+ return genl_info_userhdr(info);
|
||||
+}
|
||||
diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c
|
||||
index 71ed4272614e..538c31202e4b 100644
|
||||
--- a/drbd/drbd_nl.c
|
||||
+++ b/drbd/drbd_nl.c
|
||||
@@ -203,7 +203,7 @@ static struct drbd_path *first_path(struct drbd_connection *connection)
|
||||
static int drbd_adm_prepare(struct drbd_config_context *adm_ctx,
|
||||
struct sk_buff *skb, struct genl_info *info, unsigned flags)
|
||||
{
|
||||
- struct drbd_genlmsghdr *d_in = info->userhdr;
|
||||
+ struct drbd_genlmsghdr *d_in = genl_info_userhdr(info);
|
||||
const u8 cmd = info->genlhdr->cmd;
|
||||
int err;
|
||||
|
||||
@@ -2106,7 +2106,7 @@ static void drbd_try_suspend_al(struct drbd_device *device)
|
||||
|
||||
static bool should_set_defaults(struct genl_info *info)
|
||||
{
|
||||
- unsigned flags = ((struct drbd_genlmsghdr*)info->userhdr)->flags;
|
||||
+ unsigned int flags = ((struct drbd_genlmsghdr *)genl_info_userhdr(info))->flags;
|
||||
return 0 != (flags & DRBD_GENL_F_SET_DEFAULTS);
|
||||
}
|
||||
|
||||
@@ -6279,7 +6279,7 @@ out_no_unlock:
|
||||
int drbd_adm_new_minor(struct sk_buff *skb, struct genl_info *info)
|
||||
{
|
||||
struct drbd_config_context adm_ctx;
|
||||
- struct drbd_genlmsghdr *dh = info->userhdr;
|
||||
+ struct drbd_genlmsghdr *dh = genl_info_userhdr(info);
|
||||
struct device_conf device_conf;
|
||||
struct drbd_resource *resource;
|
||||
struct drbd_device *device;
|
||||
--
|
||||
2.42.1
|
||||
|
@ -1,86 +0,0 @@
|
||||
Author: Heming Zhao <heming.zhao@suse.com>
|
||||
Date: Thu Sep 28 11:12:00 2023 +0800
|
||||
Subject: drbd: fix build error against kernel v6.5.4
|
||||
|
||||
Below two upstream commits broken drbd v9.1 building
|
||||
|
||||
(belonging to v6.5-rc1)
|
||||
```
|
||||
commit dc97391e661009eab46783030d2404c9b6e6f2e7
|
||||
Author: David Howells <dhowells@redhat.com>
|
||||
Date: Fri Jun 23 23:55:12 2023 +0100
|
||||
|
||||
sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES)
|
||||
|
||||
|
||||
commit 0733ad8002916b9dbbbcfe6e92ad44d2657de1c1
|
||||
Author: Christoph Hellwig <hch@lst.de>
|
||||
Date: Thu Jun 8 13:02:58 2023 +0200
|
||||
|
||||
fs: remove the now unused FMODE_* flags
|
||||
```
|
||||
|
||||
This patch fix the build error.
|
||||
|
||||
---
|
||||
|
||||
diff -Nupr a/drbd/drbd_main.c b/drbd/drbd_main.c
|
||||
--- a/drbd/drbd_main.c 2023-09-26 11:08:57.142974614 +0800
|
||||
+++ b/drbd/drbd_main.c 2023-09-26 11:07:53.646071680 +0800
|
||||
@@ -2569,7 +2569,7 @@ enum ioc_rv {
|
||||
static enum ioc_rv inc_open_count(struct drbd_device *device, fmode_t mode)
|
||||
{
|
||||
struct drbd_resource *resource = device->resource;
|
||||
- enum ioc_rv r = mode & FMODE_NDELAY ? IOC_ABORT : IOC_SLEEP;
|
||||
+ enum ioc_rv r = mode & BLK_OPEN_NDELAY ? IOC_ABORT : IOC_SLEEP;
|
||||
|
||||
if (test_bit(DOWN_IN_PROGRESS, &resource->flags))
|
||||
return IOC_ABORT;
|
||||
@@ -2695,12 +2695,12 @@ static int drbd_open(struct gendisk *gd,
|
||||
|
||||
if (mode & FMODE_WRITE) {
|
||||
if (resource->role[NOW] == R_SECONDARY) {
|
||||
- rv = try_to_promote(device, timeout, (mode & FMODE_NDELAY));
|
||||
+ rv = try_to_promote(device, timeout, (mode & BLK_OPEN_NDELAY));
|
||||
if (rv < SS_SUCCESS)
|
||||
drbd_info(resource, "Auto-promote failed: %s (%d)\n",
|
||||
drbd_set_st_err_str(rv), rv);
|
||||
}
|
||||
- } else if ((mode & FMODE_NDELAY) == 0) {
|
||||
+ } else if ((mode & BLK_OPEN_NDELAY) == 0) {
|
||||
/* Double check peers
|
||||
*
|
||||
* Some services may try to first open ro, and only if that
|
||||
@@ -2741,7 +2741,7 @@ out:
|
||||
mutex_unlock(&resource->open_release);
|
||||
if (err) {
|
||||
drbd_release(gd);
|
||||
- if (err == -EAGAIN && !(mode & FMODE_NDELAY))
|
||||
+ if (err == -EAGAIN && !(mode & BLK_OPEN_NDELAY))
|
||||
err = -EMEDIUMTYPE;
|
||||
}
|
||||
|
||||
diff -Nupr a/drbd/drbd_transport_tcp.c b/drbd/drbd_transport_tcp.c
|
||||
--- a/drbd/drbd_transport_tcp.c 2023-09-26 11:09:04.016333505 +0800
|
||||
+++ b/drbd/drbd_transport_tcp.c 2023-09-26 11:07:59.132758771 +0800
|
||||
@@ -1193,6 +1193,8 @@ static int dtt_send_page(struct drbd_tra
|
||||
struct drbd_tcp_transport *tcp_transport =
|
||||
container_of(transport, struct drbd_tcp_transport, transport);
|
||||
struct socket *socket = tcp_transport->stream[stream];
|
||||
+ struct msghdr msghdr = { .msg_flags = MSG_SPLICE_PAGES|msg_flags, };
|
||||
+ struct bio_vec bvec;
|
||||
int len = size;
|
||||
int err = -EIO;
|
||||
|
||||
@@ -1204,7 +1206,10 @@ static int dtt_send_page(struct drbd_tra
|
||||
do {
|
||||
int sent;
|
||||
|
||||
- sent = socket->ops->sendpage(socket, page, offset, len, msg_flags);
|
||||
+ //sent = socket->ops->sendpage(socket, page, offset, len, msg_flags);
|
||||
+ bvec_set_page(&bvec, page, offset, len);
|
||||
+ iov_iter_bvec(&msghdr.msg_iter, ITER_SOURCE, &bvec, 1, len);
|
||||
+ sent = sock_sendmsg(socket, &msghdr);
|
||||
if (sent <= 0) {
|
||||
if (sent == -EAGAIN) {
|
||||
if (drbd_stream_send_timed_out(transport, stream))
|
11
drbd.changes
11
drbd.changes
@ -1,3 +1,14 @@
|
||||
------------------------------------------------------------------
|
||||
Tue Nov 13 11:56:00 UTC 2023 - Glass Su <glass.su@suse.com>
|
||||
|
||||
- drbd: fix build error against kernel v6.6.1 (boo#1217078)
|
||||
* add upstream patches
|
||||
+ 0021-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch
|
||||
+ 0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch
|
||||
+ 0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch
|
||||
* remove patch which are already included in upstream patches:
|
||||
- bsc-1215699_fix-build-error-against-kernel-v6.5.4.patch
|
||||
|
||||
------------------------------------------------------------------
|
||||
Tue Sep 26 03:35:00 UTC 2023 - Heming Zhao <heming.zhao@suse.com>
|
||||
|
||||
|
@ -56,10 +56,12 @@ Patch0017: 0017-drbd-propagate-exposed-UUIDs-only-into-established-c.patch
|
||||
Patch0018: 0018-drbd-rework-autopromote.patch
|
||||
Patch0019: 0019-compat-block-remove-the-unused-mode-argument-to-rele.patch
|
||||
Patch0020: 0020-drbd-do-not-allow-auto-demote-to-be-interrupted-by-s.patch
|
||||
Patch0021: 0021-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch
|
||||
Patch0022: 0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch
|
||||
Patch0023: 0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch
|
||||
# suse special patch
|
||||
Patch1001: bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch
|
||||
Patch1002: suse-coccinelle.patch
|
||||
Patch1003: bsc-1215699_fix-build-error-against-kernel-v6.5.4.patch
|
||||
########################
|
||||
|
||||
#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py
|
||||
@ -115,9 +117,11 @@ installed kernel.
|
||||
%patch0018 -p1
|
||||
%patch0019 -p1
|
||||
%patch0020 -p1
|
||||
%patch0021 -p1
|
||||
%patch0022 -p1
|
||||
%patch0023 -p1
|
||||
%patch1001 -p1
|
||||
%patch1002 -p1
|
||||
%patch1003 -p1
|
||||
|
||||
mkdir source
|
||||
cp -a drbd/. source/. || :
|
||||
|
Loading…
Reference in New Issue
Block a user