From 65c3c476f521a0ca6f91290e4e363d9f5c53883bfc96d4a3048978395712b487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 12:13:12 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main drbd revision ff49c8c7d655bec5bb993c6337799398 --- .gitattributes | 23 + ...-value-of-drbd_state_rv-as-well-as-s.patch | 82 + 0008-compat-block-introduce-holder-ops.patch | 80 + ...-compat-block-pass-a-gendisk-to-open.patch | 129 + ...sed-extern-for-conn_try_outdate_peer.patch | 38 + ...nclude-source-of-state-change-in-log.patch | 1480 ++++++++++ ...-the-holder-as-indication-for-exclus.patch | 202 ++ 0018-drbd-rework-autopromote.patch | 185 ++ ...ove-the-unused-mode-argument-to-rele.patch | 107 + ...lace-fmode_t-with-a-block-specific-t.patch | 183 ++ ...-remove-userhdr-from-struct-genl_inf.patch | 96 + Module.supported | 2 + _service | 18 + ...nc-finished-with-syncs-have-bits-set.patch | 13 + ...ve-sendpage-in-favour-of-sendmsg-MSG.patch | 107 + drbd-9.1.16.tar.gz | 3 + drbd.changes | 2550 +++++++++++++++++ drbd.spec | 144 + drbd_git_revision | 1 + preamble | 3 + suse-coccinelle.patch | 76 + 21 files changed, 5522 insertions(+) create mode 100644 .gitattributes create mode 100644 0006-drbd-log-numeric-value-of-drbd_state_rv-as-well-as-s.patch create mode 100644 0008-compat-block-introduce-holder-ops.patch create mode 100644 0011-compat-block-pass-a-gendisk-to-open.patch create mode 100644 0013-drbd-remove-unused-extern-for-conn_try_outdate_peer.patch create mode 100644 0014-drbd-include-source-of-state-change-in-log.patch create mode 100644 0015-compat-block-use-the-holder-as-indication-for-exclus.patch create mode 100644 0018-drbd-rework-autopromote.patch create mode 100644 0019-compat-block-remove-the-unused-mode-argument-to-rele.patch create mode 100644 0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch create mode 100644 0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch create mode 100644 Module.supported create mode 100644 _service create mode 100644 bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch create mode 100644 bsc-1216666-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch create mode 100644 drbd-9.1.16.tar.gz create mode 100644 drbd.changes create mode 100644 drbd.spec create mode 100644 drbd_git_revision create mode 100644 preamble create mode 100644 suse-coccinelle.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/0006-drbd-log-numeric-value-of-drbd_state_rv-as-well-as-s.patch b/0006-drbd-log-numeric-value-of-drbd_state_rv-as-well-as-s.patch new file mode 100644 index 0000000..f340c97 --- /dev/null +++ b/0006-drbd-log-numeric-value-of-drbd_state_rv-as-well-as-s.patch @@ -0,0 +1,82 @@ +From 8c2c783a09d81f0a725e7a3ae48be4ceb2d79a63 Mon Sep 17 00:00:00 2001 +From: Joel Colledge +Date: Fri, 8 Sep 2023 11:26:01 +0200 +Subject: [PATCH 06/20] drbd: log numeric value of drbd_state_rv as well as + string form + +"Auto-promote failed: ?" was seen in a log. Logging the numeric value of +the state change return value gives us more information about what +happened in such a case. +--- + drbd/drbd_main.c | 8 ++++---- + drbd/drbd_receiver.c | 6 +++--- + drbd/drbd_state.c | 3 ++- + 3 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c +index 810df864f60b..e26cf7e2b008 100644 +--- a/drbd/drbd_main.c ++++ b/drbd/drbd_main.c +@@ -2698,8 +2698,8 @@ static int drbd_open(struct block_device *bdev, fmode_t mode) + if (resource->role[NOW] == R_SECONDARY) { + rv = try_to_promote(device, timeout, (mode & FMODE_NDELAY)); + if (rv < SS_SUCCESS) +- drbd_info(resource, "Auto-promote failed: %s\n", +- drbd_set_st_err_str(rv)); ++ drbd_info(resource, "Auto-promote failed: %s (%d)\n", ++ drbd_set_st_err_str(rv), rv); + } + } else if ((mode & FMODE_NDELAY) == 0) { + /* Double check peers +@@ -2856,8 +2856,8 @@ static void drbd_release(struct gendisk *gd, fmode_t mode) + !test_bit(EXPLICIT_PRIMARY, &resource->flags)) { + rv = drbd_set_role(resource, R_SECONDARY, false, NULL); + if (rv < SS_SUCCESS) +- drbd_warn(resource, "Auto-demote failed: %s\n", +- drbd_set_st_err_str(rv)); ++ drbd_warn(resource, "Auto-demote failed: %s (%d)\n", ++ drbd_set_st_err_str(rv), rv); + } + } + +diff --git a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c +index 95cf7ac36762..2162d13cb25e 100644 +--- a/drbd/drbd_receiver.c ++++ b/drbd/drbd_receiver.c +@@ -983,8 +983,8 @@ static int connect_work(struct drbd_work *work, int cancel) + drbd_send_disconnect(connection); + apply_local_state_change(connection, OUTDATE_DISKS_AND_DISCONNECT, force_demote); + } else { +- drbd_info(connection, "Failure to connect %d %s; retrying\n", +- rv, drbd_set_st_err_str(rv)); ++ drbd_info(connection, "Failure to connect: %s (%d); retrying\n", ++ drbd_set_st_err_str(rv), rv); + change_cstate(connection, C_NETWORK_FAILURE, CS_HARD); + } + +@@ -6107,7 +6107,7 @@ out: + } + + if (rv < SS_SUCCESS) { +- drbd_err(resource, "State change failed: %s\n", drbd_set_st_err_str(rv)); ++ drbd_err(resource, "State change failed: %s (%d)\n", drbd_set_st_err_str(rv), rv); + if (rv == SS_PRIMARY_READER) + log_openers(resource); + } +diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c +index 8b60afeb097b..23eab7f867aa 100644 +--- a/drbd/drbd_state.c ++++ b/drbd/drbd_state.c +@@ -791,7 +791,8 @@ static enum drbd_state_rv ___end_state_change(struct drbd_resource *resource, st + rv = try_state_change(resource); + if (rv < SS_SUCCESS) { + if (flags & CS_VERBOSE) { +- drbd_err(resource, "State change failed: %s\n", drbd_set_st_err_str(rv)); ++ drbd_err(resource, "State change failed: %s (%d)\n", ++ drbd_set_st_err_str(rv), rv); + print_state_change(resource, "Failed: "); + } + goto out; +-- +2.35.3 + diff --git a/0008-compat-block-introduce-holder-ops.patch b/0008-compat-block-introduce-holder-ops.patch new file mode 100644 index 0000000..53fa4d9 --- /dev/null +++ b/0008-compat-block-introduce-holder-ops.patch @@ -0,0 +1,80 @@ +From c34a13c3df85352124e94456f81e3d4ba4f52440 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Moritz=20=22WanzenBug=22=20Wanzenb=C3=B6ck?= + +Date: Fri, 8 Sep 2023 12:20:10 +0200 +Subject: [PATCH 08/20] compat: block: introduce holder ops + +See also upstream Linux kernel commit +0718afd47f70 ("block: introduce holder ops") + +Original message: + +Add a new blk_holder_ops structure, which is passed to blkdev_get_by_* and +installed in the block_device for exclusive claims. It will be used to +allow the block layer to call back into the user of the block device for +thing like notification of a removed device or a device resize. +--- + .../cocci/blkdev_get_by_path__no_has_holder_ops.cocci | 6 ++++++ + drbd/drbd-kernel-compat/gen_patch_names.c | 3 +++ + .../tests/blkdev_get_by_path_has_holder_ops.c | 7 +++++++ + drbd/drbd_nl.c | 3 ++- + 4 files changed, 18 insertions(+), 1 deletion(-) + create mode 100644 drbd/drbd-kernel-compat/cocci/blkdev_get_by_path__no_has_holder_ops.cocci + create mode 100644 drbd/drbd-kernel-compat/tests/blkdev_get_by_path_has_holder_ops.c + +diff --git a/drbd/drbd-kernel-compat/cocci/blkdev_get_by_path__no_has_holder_ops.cocci b/drbd/drbd-kernel-compat/cocci/blkdev_get_by_path__no_has_holder_ops.cocci +new file mode 100644 +index 000000000000..050d89e6fe0d +--- /dev/null ++++ b/drbd/drbd-kernel-compat/cocci/blkdev_get_by_path__no_has_holder_ops.cocci +@@ -0,0 +1,6 @@ ++@@ ++expression path, mode, holder, ops; ++@@ ++ blkdev_get_by_path(path, mode, holder ++- , ops ++ ) +diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c +index 959bbc351e1b..7071a0a4c5ec 100644 +--- a/drbd/drbd-kernel-compat/gen_patch_names.c ++++ b/drbd/drbd-kernel-compat/gen_patch_names.c +@@ -556,6 +556,9 @@ int main(int argc, char **argv) + patch(1, "__bio_add_page", true, false, + COMPAT_HAVE___BIO_ADD_PAGE, "present"); + ++ patch(1, "blkdev_get_by_path", true, false, ++ COMPAT_BLKDEV_GET_BY_PATH_HAS_HOLDER_OPS, "has_holder_ops"); ++ + /* #define BLKDEV_ISSUE_ZEROOUT_EXPORTED */ + /* #define BLKDEV_ZERO_NOUNMAP */ + +diff --git a/drbd/drbd-kernel-compat/tests/blkdev_get_by_path_has_holder_ops.c b/drbd/drbd-kernel-compat/tests/blkdev_get_by_path_has_holder_ops.c +new file mode 100644 +index 000000000000..02a560782f37 +--- /dev/null ++++ b/drbd/drbd-kernel-compat/tests/blkdev_get_by_path_has_holder_ops.c +@@ -0,0 +1,7 @@ ++/* { "version": "v6.5-rc1", "commit": "0718afd47f70cf46877c39c25d06b786e1a3f36c", "comment": "block: introduce holder ops", "author": "Christoph Hellwig ", "date": "Thu Jun 1 11:44:52 2023 +0200" } */ ++#include ++ ++struct block_device *foo(const char *bdev_path, struct blk_holder_ops *ops) ++{ ++ return blkdev_get_by_path(bdev_path, 0, NULL, ops); ++} +diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c +index 0fc1d84a996f..0a67bfa4ca52 100644 +--- a/drbd/drbd_nl.c ++++ b/drbd/drbd_nl.c +@@ -2560,7 +2560,8 @@ static struct block_device *open_backing_dev(struct drbd_device *device, + const char *bdev_path, void *claim_ptr) + { + struct block_device *bdev = blkdev_get_by_path(bdev_path, +- FMODE_READ | FMODE_WRITE | FMODE_EXCL, claim_ptr); ++ FMODE_READ | FMODE_WRITE | FMODE_EXCL, ++ claim_ptr, NULL); + if (IS_ERR(bdev)) { + drbd_err(device, "open(\"%s\") failed with %ld\n", + bdev_path, PTR_ERR(bdev)); +-- +2.35.3 + diff --git a/0011-compat-block-pass-a-gendisk-to-open.patch b/0011-compat-block-pass-a-gendisk-to-open.patch new file mode 100644 index 0000000..a5b00ee --- /dev/null +++ b/0011-compat-block-pass-a-gendisk-to-open.patch @@ -0,0 +1,129 @@ +From b993152e80676f5b9ce583c9471b630cbd0675d7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Moritz=20=22WanzenBug=22=20Wanzenb=C3=B6ck?= + +Date: Fri, 8 Sep 2023 15:09:47 +0200 +Subject: [PATCH 11/20] compat: block: pass a gendisk to ->open + +See also upstream Linux kernel commit +d32e2bf83791 ("block: pass a gendisk to ->open") + +Original message: + +->open is only called on the whole device. Make that explicit by +passing a gendisk instead of the block_device. +--- + ...ice_operations_open__no_takes_gendisk.cocci | 18 ++++++++++++++++++ + drbd/drbd-kernel-compat/gen_patch_names.c | 3 +++ + ...lock_device_operations_open_takes_gendisk.c | 17 +++++++++++++++++ + drbd/drbd_main.c | 10 +++++----- + 4 files changed, 43 insertions(+), 5 deletions(-) + create mode 100644 drbd/drbd-kernel-compat/cocci/block_device_operations_open__no_takes_gendisk.cocci + create mode 100644 drbd/drbd-kernel-compat/tests/block_device_operations_open_takes_gendisk.c + +diff --git a/drbd/drbd-kernel-compat/cocci/block_device_operations_open__no_takes_gendisk.cocci b/drbd/drbd-kernel-compat/cocci/block_device_operations_open__no_takes_gendisk.cocci +new file mode 100644 +index 000000000000..2ba2856da9db +--- /dev/null ++++ b/drbd/drbd-kernel-compat/cocci/block_device_operations_open__no_takes_gendisk.cocci +@@ -0,0 +1,18 @@ ++@ drbd_open_arg @ ++identifier gd; ++fresh identifier bdev = "" ## "bdev"; ++@@ ++ drbd_open( ++- struct gendisk *gd, +++ struct block_device *bdev, ++ ... ) { ++<... ++( ++- gd->part0 +++ bdev ++| ++- gd +++ bdev->bd_disk ++) ++...> ++} +diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c +index 7071a0a4c5ec..6e4f06d9a3a7 100644 +--- a/drbd/drbd-kernel-compat/gen_patch_names.c ++++ b/drbd/drbd-kernel-compat/gen_patch_names.c +@@ -559,6 +559,9 @@ int main(int argc, char **argv) + patch(1, "blkdev_get_by_path", true, false, + COMPAT_BLKDEV_GET_BY_PATH_HAS_HOLDER_OPS, "has_holder_ops"); + ++ patch(1, "block_device_operations_open", true, false, ++ COMPAT_BLOCK_DEVICE_OPERATIONS_OPEN_TAKES_GENDISK, "takes_gendisk"); ++ + /* #define BLKDEV_ISSUE_ZEROOUT_EXPORTED */ + /* #define BLKDEV_ZERO_NOUNMAP */ + +diff --git a/drbd/drbd-kernel-compat/tests/block_device_operations_open_takes_gendisk.c b/drbd/drbd-kernel-compat/tests/block_device_operations_open_takes_gendisk.c +new file mode 100644 +index 000000000000..d5f20fd569fb +--- /dev/null ++++ b/drbd/drbd-kernel-compat/tests/block_device_operations_open_takes_gendisk.c +@@ -0,0 +1,17 @@ ++/* { "version": "v6.5-rc1", "commit": "d32e2bf83791727a84ad5d3e3d713e82f9adbe30", "comment": "block: pass a gendisk to ->open", "author": "Christoph Hellwig ", "date": "Thu Jun 8 13:02:36 2023 +0200" } */ ++#include ++ ++#ifndef __same_type ++# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) ++#endif ++ ++int foo_open(struct gendisk *disk, unsigned int mode) ++{ ++ return 0; ++} ++ ++void foo(void) ++{ ++ struct block_device_operations ops; ++ BUILD_BUG_ON(!(__same_type(ops.open, &foo_open))); ++} +diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c +index e6ed1185c710..53cb4c9e7db3 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 block_device *bdev, fmode_t mode); ++static int drbd_open(struct gendisk *gd, fmode_t mode); + static void drbd_release(struct gendisk *gd, fmode_t mode); + static void md_sync_timer_fn(struct timer_list *t); + static int w_bitmap_io(struct drbd_work *w, int unused); +@@ -2646,9 +2646,9 @@ out: + spin_unlock(&device->openers_lock); + } + +-static int drbd_open(struct block_device *bdev, fmode_t mode) ++static int drbd_open(struct gendisk *gd, fmode_t mode) + { +- struct drbd_device *device = bdev->bd_disk->private_data; ++ struct drbd_device *device = gd->private_data; + struct drbd_resource *resource = device->resource; + long timeout = resource->res_opts.auto_promote_timeout * HZ / 10; + enum ioc_rv r; +@@ -2664,7 +2664,7 @@ static int drbd_open(struct block_device *bdev, fmode_t mode) + + /* Fail read-write open early, + * in case someone explicitly set us read-only (blockdev --setro) */ +- if (bdev_read_only(bdev) && (mode & FMODE_WRITE)) ++ if (bdev_read_only(gd->part0) && (mode & FMODE_WRITE)) + return -EACCES; + + if (resource->fail_io[NOW]) +@@ -2740,7 +2740,7 @@ out: + + mutex_unlock(&resource->open_release); + if (err) { +- drbd_release(bdev->bd_disk, mode); ++ drbd_release(gd, mode); + if (err == -EAGAIN && !(mode & FMODE_NDELAY)) + err = -EMEDIUMTYPE; + } +-- +2.35.3 + diff --git a/0013-drbd-remove-unused-extern-for-conn_try_outdate_peer.patch b/0013-drbd-remove-unused-extern-for-conn_try_outdate_peer.patch new file mode 100644 index 0000000..9d3a99b --- /dev/null +++ b/0013-drbd-remove-unused-extern-for-conn_try_outdate_peer.patch @@ -0,0 +1,38 @@ +From 9e087399533445e3df60a34f26a1e6a285b0504a Mon Sep 17 00:00:00 2001 +From: Joel Colledge +Date: Tue, 12 Sep 2023 16:36:43 +0200 +Subject: [PATCH 13/20] drbd: remove unused extern for conn_try_outdate_peer() + +--- + drbd/drbd_int.h | 1 - + drbd/drbd_nl.c | 2 +- + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drbd/drbd_int.h b/drbd/drbd_int.h +index 4f3228d5a4d1..f6e7c3ac2629 100644 +--- a/drbd/drbd_int.h ++++ b/drbd/drbd_int.h +@@ -1932,7 +1932,6 @@ extern void drbd_reconsider_queue_parameters(struct drbd_device *device, + struct drbd_backing_dev *bdev); + extern bool barrier_pending(struct drbd_resource *resource); + extern enum drbd_state_rv drbd_set_role(struct drbd_resource *, enum drbd_role, bool, struct sk_buff *); +-extern bool conn_try_outdate_peer(struct drbd_connection *connection); + extern void conn_try_outdate_peer_async(struct drbd_connection *connection); + extern int drbd_maybe_khelper(struct drbd_device *, struct drbd_connection *, char *); + extern int drbd_create_peer_device_default_config(struct drbd_peer_device *peer_device); +diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c +index 0a67bfa4ca52..cb5cdb184824 100644 +--- a/drbd/drbd_nl.c ++++ b/drbd/drbd_nl.c +@@ -768,7 +768,7 @@ static bool intentional_diskless(struct drbd_resource *resource) + return intentional_diskless; + } + +-bool conn_try_outdate_peer(struct drbd_connection *connection) ++static bool conn_try_outdate_peer(struct drbd_connection *connection) + { + struct drbd_resource *resource = connection->resource; + unsigned long last_reconnect_jif; +-- +2.35.3 + diff --git a/0014-drbd-include-source-of-state-change-in-log.patch b/0014-drbd-include-source-of-state-change-in-log.patch new file mode 100644 index 0000000..8d215ce --- /dev/null +++ b/0014-drbd-include-source-of-state-change-in-log.patch @@ -0,0 +1,1480 @@ +From d6bbb1b1635b9912d77d1a26aba3f380a2ed986d Mon Sep 17 00:00:00 2001 +From: Joel Colledge +Date: Mon, 11 Sep 2023 16:45:27 +0200 +Subject: [PATCH 14/20] drbd: include source of state change in log + +This is useful for understanding why a state change occurs. In +particular, whether it was triggered by userspace. +--- + drbd/drbd_int.h | 10 ++-- + drbd/drbd_main.c | 12 ++--- + drbd/drbd_nl.c | 103 ++++++++++++++++++++------------------ + drbd/drbd_receiver.c | 77 +++++++++++++++------------- + drbd/drbd_req.c | 6 +-- + drbd/drbd_sender.c | 25 ++++++---- + drbd/drbd_state.c | 116 ++++++++++++++++++++++++------------------- + drbd/drbd_state.h | 40 +++++++++++---- + 8 files changed, 224 insertions(+), 165 deletions(-) + +diff --git a/drbd/drbd_int.h b/drbd/drbd_int.h +index f6e7c3ac2629..b705f26e71a4 100644 +--- a/drbd/drbd_int.h ++++ b/drbd/drbd_int.h +@@ -1876,7 +1876,8 @@ extern void drbd_destroy_resource(struct kref *kref); + + extern void drbd_destroy_device(struct kref *kref); + +-extern int set_resource_options(struct drbd_resource *resource, struct res_opts *res_opts); ++extern int set_resource_options(struct drbd_resource *resource, struct res_opts *res_opts, ++ const char *tag); + extern struct drbd_connection *drbd_create_connection(struct drbd_resource *resource, + struct drbd_transport_class *tc); + extern void drbd_transport_shutdown(struct drbd_connection *connection, enum drbd_tr_free_op op); +@@ -1931,7 +1932,9 @@ extern void resync_after_online_grow(struct drbd_peer_device *); + extern void drbd_reconsider_queue_parameters(struct drbd_device *device, + struct drbd_backing_dev *bdev); + extern bool barrier_pending(struct drbd_resource *resource); +-extern enum drbd_state_rv drbd_set_role(struct drbd_resource *, enum drbd_role, bool, struct sk_buff *); ++extern enum drbd_state_rv ++drbd_set_role(struct drbd_resource *resource, enum drbd_role role, bool force, const char *tag, ++ struct sk_buff *reply_skb); + extern void conn_try_outdate_peer_async(struct drbd_connection *connection); + extern int drbd_maybe_khelper(struct drbd_device *, struct drbd_connection *, char *); + extern int drbd_create_peer_device_default_config(struct drbd_peer_device *peer_device); +@@ -1943,7 +1946,8 @@ extern int drbd_worker(struct drbd_thread *thi); + enum drbd_ret_code drbd_resync_after_valid(struct drbd_device *device, int o_minor); + void drbd_resync_after_changed(struct drbd_device *device); + extern bool drbd_stable_sync_source_present(struct drbd_peer_device *, enum which_state); +-extern void drbd_start_resync(struct drbd_peer_device *, enum drbd_repl_state); ++extern void drbd_start_resync(struct drbd_peer_device *peer_device, enum drbd_repl_state side, ++ const char *tag); + extern void resume_next_sg(struct drbd_device *device); + extern void suspend_other_sg(struct drbd_device *device); + extern void drbd_resync_finished(struct drbd_peer_device *, enum drbd_disk_state); +diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c +index 6bb618909aa0..4b0b967c2c97 100644 +--- a/drbd/drbd_main.c ++++ b/drbd/drbd_main.c +@@ -2505,7 +2505,7 @@ static int try_to_promote(struct drbd_device *device, long timeout, bool ndelay) + unsigned long start = jiffies; + long t; + +- rv = drbd_set_role(resource, R_PRIMARY, false, NULL); ++ rv = drbd_set_role(resource, R_PRIMARY, false, "auto-promote", NULL); + timeout -= jiffies - start; + + if (ndelay || rv >= SS_SUCCESS || timeout <= 0) { +@@ -2854,7 +2854,7 @@ static void drbd_release(struct gendisk *gd, fmode_t mode) + open_rw_cnt == 0 && + resource->role[NOW] == R_PRIMARY && + !test_bit(EXPLICIT_PRIMARY, &resource->flags)) { +- rv = drbd_set_role(resource, R_SECONDARY, false, NULL); ++ rv = drbd_set_role(resource, R_SECONDARY, false, "auto-demote", NULL); + if (rv < SS_SUCCESS) + drbd_warn(resource, "Auto-demote failed: %s (%d)\n", + drbd_set_st_err_str(rv), rv); +@@ -2866,7 +2866,7 @@ static void drbd_release(struct gendisk *gd, fmode_t mode) + + begin_state_change(resource, &irq_flags, CS_VERBOSE); + resource->fail_io[NEW] = false; +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "release"); + } + + /* if the open counts are 0, we free the whole list, otherwise we remove the specific pid */ +@@ -3349,7 +3349,7 @@ static void wake_all_device_misc(struct drbd_resource *resource) + rcu_read_unlock(); + } + +-int set_resource_options(struct drbd_resource *resource, struct res_opts *res_opts) ++int set_resource_options(struct drbd_resource *resource, struct res_opts *res_opts, const char *tag) + { + struct drbd_connection *connection; + cpumask_var_t new_cpu_mask; +@@ -3414,7 +3414,7 @@ int set_resource_options(struct drbd_resource *resource, struct res_opts *res_op + + if (force_state_recalc) { + begin_state_change(resource, &irq_flags, CS_VERBOSE | CS_FORCE_RECALC); +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, tag); + } + + if (wake_device_misc) +@@ -3491,7 +3491,7 @@ struct drbd_resource *drbd_create_resource(const char *name, + } + resource->pp_vacant = page_pool_count; + +- if (set_resource_options(resource, res_opts)) ++ if (set_resource_options(resource, res_opts, "create-resource")) + goto fail_free_pages; + + list_add_tail_rcu(&resource->resources, &drbd_resources); +diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c +index cb5cdb184824..b7e9e43312f9 100644 +--- a/drbd/drbd_nl.c ++++ b/drbd/drbd_nl.c +@@ -768,7 +768,7 @@ static bool intentional_diskless(struct drbd_resource *resource) + return intentional_diskless; + } + +-static bool conn_try_outdate_peer(struct drbd_connection *connection) ++static bool conn_try_outdate_peer(struct drbd_connection *connection, const char *tag) + { + struct drbd_resource *resource = connection->resource; + unsigned long last_reconnect_jif; +@@ -792,7 +792,7 @@ static bool conn_try_outdate_peer(struct drbd_connection *connection) + !(disk_state == D_DISKLESS && intentional_diskless(resource))) { + begin_state_change_locked(resource, CS_VERBOSE | CS_HARD); + __change_io_susp_fencing(connection, false); +- end_state_change_locked(resource); ++ end_state_change_locked(resource, tag); + read_unlock_irq(&resource->state_rwlock); + return false; + } +@@ -862,7 +862,7 @@ static bool conn_try_outdate_peer(struct drbd_connection *connection) + goto abort; + } + +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, tag); + + goto out; + abort: +@@ -875,7 +875,7 @@ static int _try_outdate_peer_async(void *data) + { + struct drbd_connection *connection = (struct drbd_connection *)data; + +- conn_try_outdate_peer(connection); ++ conn_try_outdate_peer(connection, "outdate-async"); + + kref_debug_put(&connection->kref_debug, 4); + kref_put(&connection->kref, drbd_destroy_connection); +@@ -1014,7 +1014,8 @@ static bool wait_up_to_date(struct drbd_resource *resource) + } + + enum drbd_state_rv +-drbd_set_role(struct drbd_resource *resource, enum drbd_role role, bool force, struct sk_buff *reply_skb) ++drbd_set_role(struct drbd_resource *resource, enum drbd_role role, bool force, const char *tag, ++ struct sk_buff *reply_skb) + { + struct drbd_device *device; + int vnr, try = 0; +@@ -1042,7 +1043,7 @@ retry: + err_str = NULL; + } + rv = stable_state_change(resource, +- change_role(resource, role, flags, &err_str)); ++ change_role(resource, role, flags, tag, &err_str)); + + if (rv == SS_TIMEOUT || rv == SS_CONCURRENT_ST_CHG) { + long timeout = twopc_retry_timeout(resource, try); +@@ -1104,7 +1105,7 @@ retry: + if (device->disk_state[NOW] != D_CONSISTENT) + continue; + +- if (conn_try_outdate_peer(connection)) ++ if (conn_try_outdate_peer(connection, tag)) + fenced_peers = true; + else + any_fencing_failed = true; +@@ -1140,7 +1141,7 @@ retry: + + up(&resource->state_sem); /* Allow connect while fencing */ + for_each_connection_ref(connection, im, resource) { +- bool outdated_peer = conn_try_outdate_peer(connection); ++ bool outdated_peer = conn_try_outdate_peer(connection, tag); + if (!outdated_peer && force) { + drbd_warn(connection, "Forced into split brain situation!\n"); + flags |= CS_FP_LOCAL_UP_TO_DATE; +@@ -1331,7 +1332,9 @@ int drbd_adm_set_role(struct sk_buff *skb, struct genl_info *info) + new_role = info->genlhdr->cmd == DRBD_ADM_PRIMARY ? R_PRIMARY : R_SECONDARY; + rv = drbd_set_role(adm_ctx.resource, + new_role, +- parms.force, adm_ctx.reply_skb); ++ parms.force, ++ new_role == R_PRIMARY ? "primary" : "secondary", ++ adm_ctx.reply_skb); + + if (new_role == R_PRIMARY) { + if (rv >= SS_SUCCESS) +@@ -3093,7 +3096,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) + drbd_flush_workqueue(&resource->work); + + rv = stable_state_change(resource, +- change_disk_state(device, D_ATTACHING, CS_VERBOSE | CS_SERIALIZE, NULL)); ++ change_disk_state(device, D_ATTACHING, CS_VERBOSE | CS_SERIALIZE, "attach", NULL)); + retcode = (enum drbd_ret_code)rv; + if (rv >= SS_SUCCESS) + update_resource_dagtag(resource, nbc); +@@ -3353,8 +3356,8 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) + + /* change_disk_state uses disk_state_from_md(device); in case D_NEGOTIATING not + necessary, and falls back to a local state change */ +- rv = stable_state_change(resource, +- change_disk_state(device, D_NEGOTIATING, CS_VERBOSE | CS_SERIALIZE, NULL)); ++ rv = stable_state_change(resource, change_disk_state(device, ++ D_NEGOTIATING, CS_VERBOSE | CS_SERIALIZE, "attach", NULL)); + + if (rv < SS_SUCCESS) { + if (rv == SS_CW_FAILED_BY_PEER) +@@ -3385,7 +3388,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) + force_diskless_dec: + put_ldev(device); + force_diskless: +- change_disk_state(device, D_DISKLESS, CS_HARD, NULL); ++ change_disk_state(device, D_DISKLESS, CS_HARD, "attach", NULL); + fail: + mutex_unlock_cond(&resource->conf_update, &have_conf_update); + drbd_backing_dev_free(device, nbc); +@@ -3406,7 +3409,7 @@ static enum drbd_disk_state get_disk_state(struct drbd_device *device) + } + + static int adm_detach(struct drbd_device *device, bool force, bool intentional_diskless, +- struct sk_buff *reply_skb) ++ const char *tag, struct sk_buff *reply_skb) + { + const char *err_str = NULL; + int ret, retcode; +@@ -3414,7 +3417,7 @@ static int adm_detach(struct drbd_device *device, bool force, bool intentional_d + device->device_conf.intentional_diskless = intentional_diskless; + if (force) { + set_bit(FORCE_DETACH, &device->flags); +- change_disk_state(device, D_DETACHING, CS_HARD, NULL); ++ change_disk_state(device, D_DETACHING, CS_HARD, tag, NULL); + retcode = SS_SUCCESS; + goto out; + } +@@ -3422,7 +3425,7 @@ static int adm_detach(struct drbd_device *device, bool force, bool intentional_d + drbd_suspend_io(device, READ_AND_WRITE); /* so no-one is stuck in drbd_al_begin_io */ + retcode = stable_state_change(device->resource, + change_disk_state(device, D_DETACHING, +- CS_VERBOSE | CS_WAIT_COMPLETE | CS_SERIALIZE, &err_str)); ++ CS_VERBOSE | CS_WAIT_COMPLETE | CS_SERIALIZE, tag, &err_str)); + /* D_DETACHING will transition to DISKLESS. */ + drbd_resume_io(device); + ret = wait_event_interruptible(device->misc_wait, +@@ -3473,7 +3476,7 @@ int drbd_adm_detach(struct sk_buff *skb, struct genl_info *info) + + mutex_lock(&adm_ctx.resource->adm_mutex); + retcode = (enum drbd_ret_code)adm_detach(adm_ctx.device, parms.force_detach, +- parms.intentional_diskless_detach, adm_ctx.reply_skb); ++ parms.intentional_diskless_detach, "detach", adm_ctx.reply_skb); + mutex_unlock(&adm_ctx.resource->adm_mutex); + + out: +@@ -4385,7 +4388,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) + drbd_md_mark_dirty(device); + } + +- rv = change_cstate(connection, C_UNCONNECTED, CS_VERBOSE); ++ rv = change_cstate_tag(connection, C_UNCONNECTED, CS_VERBOSE, "connect", NULL); + drbd_adm_finish(&adm_ctx, info, rv); + return 0; + out: +@@ -4535,7 +4538,7 @@ int drbd_open_ro_count(struct drbd_resource *resource) + } + + static enum drbd_state_rv conn_try_disconnect(struct drbd_connection *connection, bool force, +- struct sk_buff *reply_skb) ++ const char *tag, struct sk_buff *reply_skb) + { + struct drbd_resource *resource = connection->resource; + enum drbd_conn_state cstate; +@@ -4545,7 +4548,7 @@ static enum drbd_state_rv conn_try_disconnect(struct drbd_connection *connection + long t; + + repeat: +- rv = change_cstate_es(connection, C_DISCONNECTING, flags, &err_str); ++ rv = change_cstate_tag(connection, C_DISCONNECTING, flags, tag, &err_str); + switch (rv) { + case SS_CW_FAILED_BY_PEER: + case SS_NEED_CONNECTION: +@@ -4571,7 +4574,7 @@ static enum drbd_state_rv conn_try_disconnect(struct drbd_connection *connection + break; + case SS_IS_DISKLESS: + case SS_LOWER_THAN_OUTDATED: +- rv = change_cstate(connection, C_DISCONNECTING, CS_HARD); ++ rv = change_cstate_tag(connection, C_DISCONNECTING, CS_HARD, tag, NULL); + break; + case SS_NO_QUORUM: + if (!(flags & CS_VERBOSE)) { +@@ -4597,7 +4600,7 @@ static enum drbd_state_rv conn_try_disconnect(struct drbd_connection *connection + + /* this can only be called immediately after a successful + * peer_try_disconnect, within the same resource->adm_mutex */ +-static void del_connection(struct drbd_connection *connection) ++static void del_connection(struct drbd_connection *connection, const char *tag) + { + struct drbd_resource *resource = connection->resource; + struct drbd_peer_device *peer_device; +@@ -4619,7 +4622,7 @@ static void del_connection(struct drbd_connection *connection) + * after drbd_receiver() returned. Typically, we should be + * C_STANDALONE already, now, and this becomes a no-op. + */ +- rv2 = change_cstate(connection, C_STANDALONE, CS_VERBOSE | CS_HARD); ++ rv2 = change_cstate_tag(connection, C_STANDALONE, CS_VERBOSE | CS_HARD, tag, NULL); + if (rv2 < SS_SUCCESS) + drbd_err(connection, + "unexpected rv2=%d in del_connection()\n", +@@ -4654,6 +4657,7 @@ static int adm_disconnect(struct sk_buff *skb, struct genl_info *info, bool dest + struct drbd_connection *connection; + enum drbd_state_rv rv; + enum drbd_ret_code retcode; ++ const char *tag = destroy ? "del-peer" : "disconnect"; + + retcode = drbd_adm_prepare(&adm_ctx, skb, info, DRBD_ADM_NEED_CONNECTION); + if (!adm_ctx.reply_skb) +@@ -4671,10 +4675,10 @@ static int adm_disconnect(struct sk_buff *skb, struct genl_info *info, bool dest + + connection = adm_ctx.connection; + mutex_lock(&adm_ctx.resource->adm_mutex); +- rv = conn_try_disconnect(connection, parms.force_disconnect, adm_ctx.reply_skb); ++ rv = conn_try_disconnect(connection, parms.force_disconnect, tag, adm_ctx.reply_skb); + if (rv >= SS_SUCCESS && destroy) { + mutex_lock(&connection->resource->conf_update); +- del_connection(connection); ++ del_connection(connection, tag); + mutex_unlock(&connection->resource->conf_update); + } + if (rv < SS_SUCCESS) +@@ -4721,10 +4725,10 @@ void resync_after_online_grow(struct drbd_peer_device *peer_device) + + if (!sync_source && connection->agreed_pro_version < 110) { + stable_change_repl_state(peer_device, L_WF_SYNC_UUID, +- CS_VERBOSE | CS_SERIALIZE); ++ CS_VERBOSE | CS_SERIALIZE, "online-grow"); + return; + } +- drbd_start_resync(peer_device, sync_source ? L_SYNC_SOURCE : L_SYNC_TARGET); ++ drbd_start_resync(peer_device, sync_source ? L_SYNC_SOURCE : L_SYNC_TARGET, "online-grow"); + } + + sector_t drbd_local_max_size(struct drbd_device *device) __must_hold(local) +@@ -4956,7 +4960,7 @@ int drbd_adm_resource_opts(struct sk_buff *skb, struct genl_info *info) + goto fail; + } + +- err = set_resource_options(adm_ctx.resource, &res_opts); ++ err = set_resource_options(adm_ctx.resource, &res_opts, "resource-options"); + if (err) { + retcode = ERR_INVALID_REQUEST; + if (err == -ENOMEM) +@@ -4976,11 +4980,11 @@ static enum drbd_state_rv invalidate_resync(struct drbd_peer_device *peer_device + + drbd_flush_workqueue(&peer_device->connection->sender_work); + +- rv = change_repl_state(peer_device, L_STARTING_SYNC_T, CS_SERIALIZE); ++ rv = change_repl_state(peer_device, L_STARTING_SYNC_T, CS_SERIALIZE, "invalidate"); + + if (rv < SS_SUCCESS && rv != SS_NEED_CONNECTION) + rv = stable_change_repl_state(peer_device, L_STARTING_SYNC_T, +- CS_VERBOSE | CS_SERIALIZE); ++ CS_VERBOSE | CS_SERIALIZE, "invalidate"); + + wait_event_interruptible(resource->state_wait, + peer_device->repl_state[NOW] != L_STARTING_SYNC_T); +@@ -5005,7 +5009,7 @@ static enum drbd_state_rv invalidate_no_resync(struct drbd_device *device) __mus + } + } + __change_disk_state(device, D_INCONSISTENT); +- rv = end_state_change(resource, &irq_flags); ++ rv = end_state_change(resource, &irq_flags, "invalidate"); + + if (rv >= SS_SUCCESS) { + drbd_bitmap_io(device, &drbd_bmio_set_all_n_write, +@@ -5080,7 +5084,8 @@ int drbd_adm_invalidate(struct sk_buff *skb, struct genl_info *info) + retcode = invalidate_resync(sync_from_peer_device); + } else { + retcode = change_repl_state(sync_from_peer_device, L_WF_BITMAP_T, +- CS_VERBOSE | CS_CLUSTER_WIDE | CS_WAIT_COMPLETE | CS_SERIALIZE); ++ CS_VERBOSE | CS_CLUSTER_WIDE | CS_WAIT_COMPLETE | ++ CS_SERIALIZE, "invalidate"); + } + } else { + int retry = 3; +@@ -5103,7 +5108,8 @@ int drbd_adm_invalidate(struct sk_buff *skb, struct genl_info *info) + } + retcode = change_repl_state(peer_device, L_WF_BITMAP_T, + CS_VERBOSE | CS_CLUSTER_WIDE | +- CS_WAIT_COMPLETE | CS_SERIALIZE); ++ CS_WAIT_COMPLETE | CS_SERIALIZE, ++ "invalidate"); + } + if (retcode >= SS_SUCCESS) + goto out; +@@ -5140,13 +5146,15 @@ static int full_sync_from_peer(struct drbd_peer_device *peer_device) + struct drbd_resource *resource = device->resource; + int retcode; /* enum drbd_ret_code rsp. enum drbd_state_rv */ + +- retcode = stable_change_repl_state(peer_device, L_STARTING_SYNC_S, CS_SERIALIZE); ++ retcode = stable_change_repl_state(peer_device, L_STARTING_SYNC_S, CS_SERIALIZE, ++ "invalidate-remote"); + if (retcode < SS_SUCCESS) { + if (retcode == SS_NEED_CONNECTION && resource->role[NOW] == R_PRIMARY) { + /* The peer will get a resync upon connect anyways. + * Just make that into a full resync. */ + retcode = change_peer_disk_state(peer_device, D_INCONSISTENT, +- CS_VERBOSE | CS_WAIT_COMPLETE | CS_SERIALIZE); ++ CS_VERBOSE | CS_WAIT_COMPLETE | CS_SERIALIZE, ++ "invalidate-remote"); + if (retcode >= SS_SUCCESS) { + if (drbd_bitmap_io(device, &drbd_bmio_set_susp_al, + "set_n_write from invalidate_peer", +@@ -5155,7 +5163,7 @@ static int full_sync_from_peer(struct drbd_peer_device *peer_device) + } + } else { + retcode = stable_change_repl_state(peer_device, L_STARTING_SYNC_S, +- CS_VERBOSE | CS_SERIALIZE); ++ CS_VERBOSE | CS_SERIALIZE, "invalidate-remote"); + } + } + +@@ -5214,7 +5222,8 @@ int drbd_adm_invalidate_peer(struct sk_buff *skb, struct genl_info *info) + retcode = full_sync_from_peer(peer_device); + } else { + retcode = change_repl_state(peer_device, L_WF_BITMAP_S, +- CS_VERBOSE | CS_CLUSTER_WIDE | CS_WAIT_COMPLETE | CS_SERIALIZE); ++ CS_VERBOSE | CS_CLUSTER_WIDE | CS_WAIT_COMPLETE | CS_SERIALIZE, ++ "invalidate-remote"); + } + drbd_resume_io(device); + +@@ -5329,7 +5338,7 @@ int drbd_adm_resume_io(struct sk_buff *skb, struct genl_info *info) + __change_io_susp_fencing(connection, false); + + __change_io_susp_quorum(resource, false); +- retcode = end_state_change(resource, &irq_flags); ++ retcode = end_state_change(resource, &irq_flags, "resume-io"); + drbd_resume_io(device); + mutex_unlock(&adm_ctx.resource->adm_mutex); + drbd_adm_finish(&adm_ctx, info, retcode); +@@ -5348,7 +5357,7 @@ int drbd_adm_outdate(struct sk_buff *skb, struct genl_info *info) + + retcode = stable_state_change(adm_ctx.device->resource, + change_disk_state(adm_ctx.device, D_OUTDATED, +- CS_VERBOSE | CS_WAIT_COMPLETE | CS_SERIALIZE, NULL)); ++ CS_VERBOSE | CS_WAIT_COMPLETE | CS_SERIALIZE, "outdate", NULL)); + + mutex_unlock(&adm_ctx.resource->adm_mutex); + drbd_adm_finish(&adm_ctx, info, retcode); +@@ -6010,7 +6019,7 @@ int drbd_adm_start_ov(struct sk_buff *skb, struct genl_info *info) + drbd_suspend_io(device, READ_AND_WRITE); + wait_event(device->misc_wait, !atomic_read(&device->pending_bitmap_work.n)); + rv = stable_change_repl_state(peer_device, +- L_VERIFY_S, CS_VERBOSE | CS_WAIT_COMPLETE | CS_SERIALIZE); ++ L_VERIFY_S, CS_VERBOSE | CS_WAIT_COMPLETE | CS_SERIALIZE, "verify"); + drbd_resume_io(device); + + mutex_unlock(&adm_ctx.resource->adm_mutex); +@@ -6082,7 +6091,7 @@ int drbd_adm_new_c_uuid(struct sk_buff *skb, struct genl_info *info) + unsigned long irq_flags; + begin_state_change(device->resource, &irq_flags, CS_VERBOSE); + __change_disk_state(device, D_UP_TO_DATE); +- end_state_change(device->resource, &irq_flags); ++ end_state_change(device->resource, &irq_flags, "new-c-uuid"); + + for_each_peer_device(peer_device, device) { + if (NODE_MASK(peer_device->node_id) & nodes) { +@@ -6122,7 +6131,7 @@ int drbd_adm_new_c_uuid(struct sk_buff *skb, struct genl_info *info) + if (NODE_MASK(peer_device->node_id) & diskful) + __change_peer_disk_state(peer_device, D_UP_TO_DATE); + } +- end_state_change(device->resource, &irq_flags); ++ end_state_change(device->resource, &irq_flags, "new-c-uuid"); + } + + drbd_md_sync_if_dirty(device); +@@ -6353,7 +6362,7 @@ static enum drbd_ret_code adm_del_minor(struct drbd_device *device) + + for_each_peer_device_ref(peer_device, im, device) + stable_change_repl_state(peer_device, L_OFF, +- CS_VERBOSE | CS_WAIT_COMPLETE); ++ CS_VERBOSE | CS_WAIT_COMPLETE, "del-minor"); + + /* If drbd_ldev_destroy() is pending, wait for it to run before + * unregistering the device. */ +@@ -6465,7 +6474,7 @@ int drbd_adm_down(struct sk_buff *skb, struct genl_info *info) + mutex_lock(&resource->adm_mutex); + set_bit(DOWN_IN_PROGRESS, &resource->flags); + /* demote */ +- retcode = drbd_set_role(resource, R_SECONDARY, false, adm_ctx.reply_skb); ++ retcode = drbd_set_role(resource, R_SECONDARY, false, "down", adm_ctx.reply_skb); + if (retcode < SS_SUCCESS) { + opener_info(adm_ctx.resource, adm_ctx.reply_skb, retcode); + goto out; +@@ -6474,10 +6483,10 @@ int drbd_adm_down(struct sk_buff *skb, struct genl_info *info) + for_each_connection_ref(connection, im, resource) { + retcode = SS_SUCCESS; + if (connection->cstate[NOW] > C_STANDALONE) +- retcode = conn_try_disconnect(connection, 0, adm_ctx.reply_skb); ++ retcode = conn_try_disconnect(connection, 0, "down", adm_ctx.reply_skb); + if (retcode >= SS_SUCCESS) { + mutex_lock(&resource->conf_update); +- del_connection(connection); ++ del_connection(connection, "down"); + mutex_unlock(&resource->conf_update); + } else { + kref_debug_put(&connection->kref_debug, 13); +@@ -6491,7 +6500,7 @@ int drbd_adm_down(struct sk_buff *skb, struct genl_info *info) + idr_for_each_entry(&resource->devices, device, i) { + kref_get(&device->kref); + rcu_read_unlock(); +- retcode = adm_detach(device, 0, 0, adm_ctx.reply_skb); ++ retcode = adm_detach(device, 0, 0, "down", adm_ctx.reply_skb); + mutex_lock(&resource->conf_update); + ret = adm_del_minor(device); + mutex_unlock(&resource->conf_update); +diff --git a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c +index 223353b1081c..0c3ab0fd486c 100644 +--- a/drbd/drbd_receiver.c ++++ b/drbd/drbd_receiver.c +@@ -920,7 +920,7 @@ static void apply_local_state_change(struct drbd_connection *connection, enum ao + resource->role[NEW] = R_SECONDARY; + } + } +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "connect-failed"); + } + + static int connect_work(struct drbd_work *work, int cancel) +@@ -945,8 +945,9 @@ static int connect_work(struct drbd_work *work, int cancel) + rv = SS_CONCURRENT_ST_CHG; + break; + } +- rv = change_cstate(connection, C_CONNECTED, CS_SERIALIZE | +- CS_ALREADY_SERIALIZED | CS_VERBOSE | CS_DONT_RETRY); ++ rv = change_cstate_tag(connection, C_CONNECTED, CS_SERIALIZE | ++ CS_ALREADY_SERIALIZED | CS_VERBOSE | CS_DONT_RETRY, ++ "connected", NULL); + up(&resource->state_sem); + if (rv != SS_PRIMARY_READER) + break; +@@ -1011,7 +1012,8 @@ static bool conn_connect(struct drbd_connection *connection) + start: + have_mutex = false; + clear_bit(DISCONNECT_EXPECTED, &connection->flags); +- if (change_cstate(connection, C_CONNECTING, CS_VERBOSE) < SS_SUCCESS) { ++ if (change_cstate_tag(connection, C_CONNECTING, CS_VERBOSE, "connecting", NULL) ++ < SS_SUCCESS) { + /* We do not have a network config. */ + return false; + } +@@ -3697,7 +3699,8 @@ static enum sync_strategy drbd_asb_recover_1p(struct drbd_peer_device *peer_devi + /* drbd_change_state() does not sleep while in SS_IN_TRANSIENT_STATE, + * we might be here in L_OFF which is transient. + * we do not need to wait for the after state change work either. */ +- rv2 = change_role(resource, R_SECONDARY, CS_VERBOSE, NULL); ++ rv2 = change_role(resource, R_SECONDARY, CS_VERBOSE, ++ "after-sb-1pri", NULL); + if (rv2 != SS_SUCCESS) { + drbd_maybe_khelper(device, connection, "pri-lost-after-sb"); + } else { +@@ -3750,7 +3753,8 @@ static enum sync_strategy drbd_asb_recover_2p(struct drbd_peer_device *peer_devi + /* drbd_change_state() does not sleep while in SS_IN_TRANSIENT_STATE, + * we might be here in L_OFF which is transient. + * we do not need to wait for the after state change work either. */ +- rv2 = change_role(device->resource, R_SECONDARY, CS_VERBOSE, NULL); ++ rv2 = change_role(device->resource, R_SECONDARY, CS_VERBOSE, ++ "after-sb-2pri", NULL); + if (rv2 != SS_SUCCESS) { + drbd_maybe_khelper(device, connection, "pri-lost-after-sb"); + } else { +@@ -5500,6 +5504,7 @@ static void drbd_resync(struct drbd_peer_device *peer_device, + enum sync_rule rule; + int peer_node_id; + enum drbd_state_rv rv; ++ const char *tag = reason == AFTER_UNSTABLE ? "after-unstable" : "diskless-primary"; + + strategy = drbd_handshake(peer_device, &rule, &peer_node_id, reason == DISKLESS_PRIMARY); + if (strategy == SPLIT_BRAIN_AUTO_RECOVER && reason == AFTER_UNSTABLE) +@@ -5529,11 +5534,11 @@ static void drbd_resync(struct drbd_peer_device *peer_device, + as well. */ + drbd_info(peer_device, "Upgrading local disk to %s after unstable/weak (and no resync).\n", + drbd_disk_str(peer_disk_state)); +- change_disk_state(peer_device->device, peer_disk_state, CS_VERBOSE, NULL); ++ change_disk_state(peer_device->device, peer_disk_state, CS_VERBOSE, tag, NULL); + return; + } + +- rv = change_repl_state(peer_device, new_repl_state, CS_VERBOSE); ++ rv = change_repl_state(peer_device, new_repl_state, CS_VERBOSE, tag); + if ((rv == SS_NOTHING_TO_DO || rv == SS_RESYNC_RUNNING) && + (new_repl_state == L_WF_BITMAP_S || new_repl_state == L_WF_BITMAP_T)) { + /* Those events might happen very quickly. In case we are still processing +@@ -5633,7 +5638,7 @@ static int __receive_uuids(struct drbd_peer_device *peer_device, u64 node_mask) + begin_state_change(device->resource, &irq_flags, CS_VERBOSE); + __change_disk_state(device, D_UP_TO_DATE); + __change_peer_disk_state(peer_device, D_UP_TO_DATE); +- end_state_change(device->resource, &irq_flags); ++ end_state_change(device->resource, &irq_flags, "skip-initial-sync"); + updated_uuids = 1; + propagate_skip_initial_to_diskless(device); + } +@@ -5668,7 +5673,7 @@ static int __receive_uuids(struct drbd_peer_device *peer_device, u64 node_mask) + if (device->disk_state[NOW] == D_DISKLESS && uuid_match && + peer_device->disk_state[NOW] == D_CONSISTENT) { + drbd_info(peer_device, "Peer is on same UUID now\n"); +- change_peer_disk_state(peer_device, D_UP_TO_DATE, CS_VERBOSE); ++ change_peer_disk_state(peer_device, D_UP_TO_DATE, CS_VERBOSE, "receive-uuids"); + } + + if (updated_uuids) +@@ -5855,7 +5860,7 @@ static void check_resync_source(struct drbd_device *device, u64 weak_nodes) + return; + abort: + drbd_info(peer_device, "My sync source became a weak node, aborting resync!\n"); +- change_repl_state(peer_device, L_ESTABLISHED, CS_VERBOSE); ++ change_repl_state(peer_device, L_ESTABLISHED, CS_VERBOSE, "abort-resync"); + drbd_flush_workqueue(&device->resource->work); + + wait_event_interruptible(device->misc_wait, +@@ -6091,7 +6096,7 @@ retry: + + if (is_connect && connection->agreed_pro_version >= 117) + apply_connect(connection, (flags & CS_PREPARED) && !abort); +- rv = end_state_change(resource, &irq_flags); ++ rv = end_state_change(resource, &irq_flags, "remote"); + out: + + if ((rv == SS_NO_UP_TO_DATE_DISK && resource->role[NOW] != R_PRIMARY) || +@@ -6144,7 +6149,7 @@ change_peer_device_state(struct drbd_peer_device *peer_device, + rv = __change_connection_state(connection, mask, val, flags); + if (rv < SS_SUCCESS) + goto fail; +- rv = end_state_change(connection->resource, &irq_flags); ++ rv = end_state_change(connection->resource, &irq_flags, "remote"); + out: + return rv; + fail: +@@ -6375,7 +6380,7 @@ far_away_change(struct drbd_connection *connection, + } + + /* even if no outdate happens, CS_FORCE_RECALC might be set here */ +- return end_state_change(resource, &irq_flags); ++ return end_state_change(resource, &irq_flags, "far-away"); + } + + static void handle_neighbor_demotion(struct drbd_connection *connection, +@@ -6630,17 +6635,18 @@ cont: + /* peer is secondary */ + resync = L_SYNC_SOURCE; + } +- drbd_start_resync(peer_device, resync); ++ drbd_start_resync(peer_device, resync, "resize"); + } else { + if (tr->diskful_primary_nodes & NODE_MASK(peer_device->node_id)) +- drbd_start_resync(peer_device, L_SYNC_TARGET); ++ drbd_start_resync(peer_device, L_SYNC_TARGET, ++ "resize"); + /* else no resync */ + } + } else { + if (resource->twopc_parent_nodes & NODE_MASK(peer_device->node_id)) +- drbd_start_resync(peer_device, L_SYNC_TARGET); ++ drbd_start_resync(peer_device, L_SYNC_TARGET, "resize"); + else if (nodes_to_reach & NODE_MASK(peer_device->node_id)) +- drbd_start_resync(peer_device, L_SYNC_SOURCE); ++ drbd_start_resync(peer_device, L_SYNC_SOURCE, "resize"); + /* else no resync */ + } + } +@@ -7101,7 +7107,7 @@ void drbd_try_to_get_resynced(struct drbd_device *device) + peer_device = best_peer_device; + + if (best_strategy == NO_SYNC) { +- change_disk_state(device, D_UP_TO_DATE, CS_VERBOSE, NULL); ++ change_disk_state(device, D_UP_TO_DATE, CS_VERBOSE, "get-resync", NULL); + } else if (peer_device) { + drbd_resync(peer_device, DISKLESS_PRIMARY); + drbd_send_uuids(peer_device, UUID_FLAG_RESYNC | UUID_FLAG_DISKLESS_PRIMARY, 0); +@@ -7225,7 +7231,7 @@ static void diskless_with_peers_different_current_uuids(struct drbd_peer_device + CS_VERBOSE | CS_HARD | CS_FS_IGN_OPENERS); + resource->role[NEW] = R_SECONDARY; + /* resource->fail_io[NEW] gets set via CS_FS_IGN_OPENERS */ +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "peer-state"); + } + set_bit(CONN_HANDSHAKE_RETRY, &connection->flags); + } else if (data_successor && resource->role[NOW] == R_SECONDARY) { +@@ -7278,7 +7284,7 @@ static int receive_state(struct drbd_connection *connection, struct packet_info + if (peer_state.role == R_SECONDARY) { + begin_state_change(resource, &irq_flags, CS_HARD | CS_VERBOSE); + __change_peer_role(connection, R_SECONDARY); +- rv = end_state_change(resource, &irq_flags); ++ rv = end_state_change(resource, &irq_flags, "peer-state"); + if (rv < SS_SUCCESS) + goto fail; + } +@@ -7374,7 +7380,7 @@ static int receive_state(struct drbd_connection *connection, struct packet_info + /* Start resync after AHEAD/BEHIND */ + if (connection->agreed_pro_version >= 110 && + peer_state.conn == L_SYNC_SOURCE && old_peer_state.conn == L_BEHIND) { +- drbd_start_resync(peer_device, L_SYNC_TARGET); ++ drbd_start_resync(peer_device, L_SYNC_TARGET, "resync-after-behind"); + return 0; + } + +@@ -7519,7 +7525,7 @@ static int receive_state(struct drbd_connection *connection, struct packet_info + begin_state_change(resource, &irq_flags, CS_HARD); + __change_cstate(connection, C_PROTOCOL_ERROR); + __change_io_susp_user(resource, false); +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "abort-connect"); + return -EIO; + } + +@@ -7581,7 +7587,7 @@ static int receive_state(struct drbd_connection *connection, struct packet_info + if (repl_state[OLD] < L_ESTABLISHED && repl_state[NEW] >= L_ESTABLISHED) + resource->state_change_flags |= CS_HARD; + +- rv = end_state_change(resource, &irq_flags); ++ rv = end_state_change(resource, &irq_flags, "peer-state"); + new_repl_state = peer_device->repl_state[NOW]; + + if (rv < SS_SUCCESS) +@@ -7635,7 +7641,7 @@ static int receive_sync_uuid(struct drbd_connection *connection, struct packet_i + _drbd_uuid_set_bitmap(peer_device, 0UL); + + drbd_print_uuids(peer_device, "updated sync uuid"); +- drbd_start_resync(peer_device, L_SYNC_TARGET); ++ drbd_start_resync(peer_device, L_SYNC_TARGET, "peer-sync-uuid"); + + put_ldev(device); + } else +@@ -7935,17 +7941,18 @@ static int receive_bitmap(struct drbd_connection *connection, struct packet_info + /* We have entered drbd_start_resync() since starting the bitmap exchange. */ + drbd_warn(peer_device, "Received bitmap more than once; ignoring\n"); + } else if (repl_state == L_WF_BITMAP_S) { +- drbd_start_resync(peer_device, L_SYNC_SOURCE); ++ drbd_start_resync(peer_device, L_SYNC_SOURCE, "receive-bitmap"); + } else if (repl_state == L_WF_BITMAP_T) { + if (connection->agreed_pro_version < 110) { + enum drbd_state_rv rv; + + /* Omit CS_WAIT_COMPLETE and CS_SERIALIZE with this state + * transition to avoid deadlocks. */ +- rv = stable_change_repl_state(peer_device, L_WF_SYNC_UUID, CS_VERBOSE); ++ rv = stable_change_repl_state(peer_device, L_WF_SYNC_UUID, CS_VERBOSE, ++ "receive-bitmap"); + D_ASSERT(device, rv == SS_SUCCESS); + } else { +- drbd_start_resync(peer_device, L_SYNC_TARGET); ++ drbd_start_resync(peer_device, L_SYNC_TARGET, "receive-bitmap"); + } + } else { + /* admin may have requested C_DISCONNECTING, +@@ -8139,7 +8146,7 @@ static int receive_peer_dagtag(struct drbd_connection *connection, struct packet + __change_repl_state(peer_device, new_repl_state); + set_bit(RECONCILIATION_RESYNC, &peer_device->flags); + } +- rv = end_state_change(resource, &irq_flags); ++ rv = end_state_change(resource, &irq_flags, "receive-peer-dagtag"); + if (rv == SS_SUCCESS) + drbd_info(connection, "Reconciliation resync because \'%s\' disappeared. (o=%d)\n", + lost_peer->transport.net_conf->name, (int)dagtag_offset); +@@ -8248,7 +8255,8 @@ static int receive_current_uuid(struct drbd_connection *connection, struct packe + if (resource->remote_state_change) + set_bit(OUTDATE_ON_2PC_COMMIT, &device->flags); + else +- change_disk_state(device, D_OUTDATED, CS_VERBOSE, NULL); ++ change_disk_state(device, D_OUTDATED, CS_VERBOSE, ++ "receive-current-uuid", NULL); + } + put_ldev(device); + } else if (device->disk_state[NOW] == D_DISKLESS && resource->role[NOW] == R_PRIMARY) { +@@ -8328,7 +8336,7 @@ static int receive_rs_deallocated(struct drbd_connection *connection, struct pac + + static int receive_disconnect(struct drbd_connection *connection, struct packet_info *pi) + { +- change_cstate(connection, C_DISCONNECTING, CS_HARD); ++ change_cstate_tag(connection, C_DISCONNECTING, CS_HARD, "receive-disconnect", NULL); + return 0; + } + +@@ -8594,7 +8602,7 @@ static void conn_disconnect(struct drbd_connection *connection) + * Usually we should be in some network failure state already, + * but just in case we are not, we fix it up here. + */ +- change_cstate(connection, C_NETWORK_FAILURE, CS_HARD); ++ change_cstate_tag(connection, C_NETWORK_FAILURE, CS_HARD, "disconnected", NULL); + + del_connect_timer(connection); + +@@ -8707,10 +8715,11 @@ static void conn_disconnect(struct drbd_connection *connection) + /* drbd_receiver() has to be restarted after it returns */ + drbd_thread_restart_nowait(&connection->receiver); + } +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "disconnected"); + + if (oc == C_DISCONNECTING) +- change_cstate(connection, C_STANDALONE, CS_VERBOSE | CS_HARD | CS_LOCAL_ONLY); ++ change_cstate_tag(connection, C_STANDALONE, CS_VERBOSE | CS_HARD | CS_LOCAL_ONLY, ++ "disconnected", NULL); + } + + /* +diff --git a/drbd/drbd_req.c b/drbd/drbd_req.c +index af2ae66f51b5..41950e46ec27 100644 +--- a/drbd/drbd_req.c ++++ b/drbd/drbd_req.c +@@ -2688,7 +2688,7 @@ void request_timer_fn(struct timer_list *t) + continue; + begin_state_change(resource, &irq_flags, CS_VERBOSE | CS_HARD); + __change_cstate(connection, C_TIMEOUT); +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "timeout"); + kref_put(&connection->kref, drbd_destroy_connection); + } + +@@ -2723,7 +2723,7 @@ void drbd_handle_io_error_(struct drbd_device *device, + if (device->disk_state[NOW] > D_INCONSISTENT) { + begin_state_change_locked(device->resource, CS_HARD); + __change_disk_state(device, D_INCONSISTENT); +- end_state_change_locked(device->resource); ++ end_state_change_locked(device->resource, "local-io-error"); + } + break; + } +@@ -2740,7 +2740,7 @@ void drbd_handle_io_error_(struct drbd_device *device, + if (device->disk_state[NOW] > D_FAILED) { + begin_state_change_locked(device->resource, CS_HARD); + __change_disk_state(device, D_FAILED); +- end_state_change_locked(device->resource); ++ end_state_change_locked(device->resource, "local-io-error"); + drbd_err(device, + "Local IO failed in %s. Detaching...\n", where); + } +diff --git a/drbd/drbd_sender.c b/drbd/drbd_sender.c +index 93a460dae190..0beeb5f3cb54 100644 +--- a/drbd/drbd_sender.c ++++ b/drbd/drbd_sender.c +@@ -472,7 +472,7 @@ int w_resync_timer(struct drbd_work *w, int cancel) + unsigned long irq_flags; + begin_state_change(resource, &irq_flags, 0); + peer_device->resync_active[NEW] = false; +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "resync-inactive"); + } + break; + } +@@ -1155,7 +1155,7 @@ static void resync_again(struct drbd_device *device, u64 source_m, u64 target_m) + peer_device->resync_again--; + begin_state_change_locked(device->resource, CS_VERBOSE); + __change_repl_state(peer_device, new_repl_state); +- end_state_change_locked(device->resource); ++ end_state_change_locked(device->resource, "resync-again"); + } + } + } +@@ -1225,7 +1225,7 @@ found: + } + + drbd_send_uuids(peer_device, 0, 0); +- drbd_start_resync(peer_device, L_SYNC_TARGET); ++ drbd_start_resync(peer_device, L_SYNC_TARGET, "resync-from-primary"); + } + + static void queue_resync_finished(struct drbd_peer_device *peer_device, enum drbd_disk_state new_peer_disk_state) +@@ -1428,7 +1428,7 @@ void drbd_resync_finished(struct drbd_peer_device *peer_device, + } + + out_unlock: +- end_state_change_locked(device->resource); ++ end_state_change_locked(device->resource, "resync-finished"); + + put_ldev(device); + +@@ -1920,7 +1920,8 @@ static bool drbd_pause_after(struct drbd_device *device) + if (!__drbd_may_sync_now(other_peer_device)) + __change_resync_susp_dependency(other_peer_device, true); + } +- if (end_state_change_locked(other_device->resource) != SS_NOTHING_TO_DO) ++ if (end_state_change_locked(other_device->resource, "resync-after") != ++ SS_NOTHING_TO_DO) + changed = true; + } + rcu_read_unlock(); +@@ -1957,7 +1958,8 @@ static bool drbd_resume_next(struct drbd_device *device) + __drbd_may_sync_now(other_peer_device)) + __change_resync_susp_dependency(other_peer_device, false); + } +- if (end_state_change_locked(other_device->resource) != SS_NOTHING_TO_DO) ++ if (end_state_change_locked(other_device->resource, "resync-after") != ++ SS_NOTHING_TO_DO) + changed = true; + } + rcu_read_unlock(); +@@ -2125,7 +2127,7 @@ static void do_start_resync(struct drbd_peer_device *peer_device) + return; + } + +- drbd_start_resync(peer_device, peer_device->start_resync_side); ++ drbd_start_resync(peer_device, peer_device->start_resync_side, "postponed-resync"); + clear_bit(AHEAD_TO_SYNC_SOURCE, &peer_device->flags); + } + +@@ -2149,7 +2151,7 @@ static void handle_congestion(struct drbd_peer_device *peer_device) + else if (on_congestion == OC_DISCONNECT) + __change_cstate(peer_device->connection, C_DISCONNECTING); + } +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "congestion"); + } + rcu_read_unlock(); + +@@ -2163,7 +2165,8 @@ static void handle_congestion(struct drbd_peer_device *peer_device) + * This function might bring you directly into one of the + * C_PAUSED_SYNC_* states. + */ +-void drbd_start_resync(struct drbd_peer_device *peer_device, enum drbd_repl_state side) ++void drbd_start_resync(struct drbd_peer_device *peer_device, enum drbd_repl_state side, ++ const char *tag) + { + struct drbd_device *device = peer_device->device; + struct drbd_connection *connection = peer_device->connection; +@@ -2258,7 +2261,7 @@ skip_helper: + init_resync_stable_bits(peer_device); + finished_resync_pdsk = peer_device->resync_finished_pdsk; + peer_device->resync_finished_pdsk = D_UNKNOWN; +- r = end_state_change_locked(device->resource); ++ r = end_state_change_locked(device->resource, tag); + repl_state = peer_device->repl_state[NOW]; + + if (repl_state < L_ESTABLISHED) +@@ -2339,7 +2342,7 @@ static void go_diskless(struct drbd_device *device) + } + + drbd_md_sync_if_dirty(device); +- change_disk_state(device, D_DISKLESS, CS_HARD, NULL); ++ change_disk_state(device, D_DISKLESS, CS_HARD, "go-diskless", NULL); + } + + static int do_md_sync(struct drbd_device *device) +diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c +index 23eab7f867aa..22cd134be962 100644 +--- a/drbd/drbd_state.c ++++ b/drbd/drbd_state.c +@@ -74,8 +74,8 @@ struct change_disk_state_context { + static bool lost_contact_to_peer_data(enum drbd_disk_state *peer_disk_state); + static bool peer_returns_diskless(struct drbd_peer_device *peer_device, + enum drbd_disk_state os, enum drbd_disk_state ns); +-static void print_state_change(struct drbd_resource *resource, const char *prefix); +-static void finish_state_change(struct drbd_resource *); ++static void print_state_change(struct drbd_resource *resource, const char *prefix, const char *tag); ++static void finish_state_change(struct drbd_resource *, const char *tag); + static int w_after_state_change(struct drbd_work *w, int unused); + static enum drbd_state_rv is_valid_soft_transition(struct drbd_resource *); + static enum drbd_state_rv is_valid_transition(struct drbd_resource *resource); +@@ -774,7 +774,7 @@ static void queue_after_state_change_work(struct drbd_resource *resource, + } + + static enum drbd_state_rv ___end_state_change(struct drbd_resource *resource, struct completion *done, +- enum drbd_state_rv rv) ++ enum drbd_state_rv rv, const char *tag) + { + enum chg_state_flags flags = resource->state_change_flags; + struct drbd_connection *connection; +@@ -793,14 +793,14 @@ static enum drbd_state_rv ___end_state_change(struct drbd_resource *resource, st + if (flags & CS_VERBOSE) { + drbd_err(resource, "State change failed: %s (%d)\n", + drbd_set_st_err_str(rv), rv); +- print_state_change(resource, "Failed: "); ++ print_state_change(resource, "Failed: ", tag); + } + goto out; + } + if (flags & CS_PREPARE) + goto out; + +- finish_state_change(resource); ++ finish_state_change(resource, tag); + update_members(resource); + + /* Check whether we are establishing a connection before applying the change. */ +@@ -939,9 +939,9 @@ void begin_state_change_locked(struct drbd_resource *resource, enum chg_state_fl + __begin_state_change(resource); + } + +-enum drbd_state_rv end_state_change_locked(struct drbd_resource *resource) ++enum drbd_state_rv end_state_change_locked(struct drbd_resource *resource, const char *tag) + { +- return ___end_state_change(resource, NULL, SS_SUCCESS); ++ return ___end_state_change(resource, NULL, SS_SUCCESS, tag); + } + + void begin_state_change(struct drbd_resource *resource, unsigned long *irq_flags, enum chg_state_flags flags) +@@ -952,7 +952,8 @@ void begin_state_change(struct drbd_resource *resource, unsigned long *irq_flags + + static enum drbd_state_rv __end_state_change(struct drbd_resource *resource, + unsigned long *irq_flags, +- enum drbd_state_rv rv) ++ enum drbd_state_rv rv, ++ const char *tag) + { + enum chg_state_flags flags = resource->state_change_flags; + struct completion __done, *done = NULL; +@@ -961,26 +962,27 @@ static enum drbd_state_rv __end_state_change(struct drbd_resource *resource, + done = &__done; + init_completion(done); + } +- rv = ___end_state_change(resource, done, rv); ++ rv = ___end_state_change(resource, done, rv, tag); + __state_change_unlock(resource, irq_flags, rv >= SS_SUCCESS ? done : NULL); + return rv; + } + +-enum drbd_state_rv end_state_change(struct drbd_resource *resource, unsigned long *irq_flags) ++enum drbd_state_rv end_state_change(struct drbd_resource *resource, unsigned long *irq_flags, ++ const char *tag) + { +- return __end_state_change(resource, irq_flags, SS_SUCCESS); ++ return __end_state_change(resource, irq_flags, SS_SUCCESS, tag); + } + + void abort_state_change(struct drbd_resource *resource, unsigned long *irq_flags) + { + resource->state_change_flags &= ~CS_VERBOSE; +- __end_state_change(resource, irq_flags, SS_UNKNOWN_ERROR); ++ __end_state_change(resource, irq_flags, SS_UNKNOWN_ERROR, NULL); + } + + void abort_state_change_locked(struct drbd_resource *resource) + { + resource->state_change_flags &= ~CS_VERBOSE; +- ___end_state_change(resource, NULL, SS_UNKNOWN_ERROR); ++ ___end_state_change(resource, NULL, SS_UNKNOWN_ERROR, NULL); + } + + static void begin_remote_state_change(struct drbd_resource *resource, unsigned long *irq_flags) +@@ -1159,15 +1161,19 @@ static int scnprintf_io_suspend_flags(char *buffer, size_t size, + return b - buffer; + } + +-static void print_state_change(struct drbd_resource *resource, const char *prefix) ++static void print_state_change(struct drbd_resource *resource, const char *prefix, const char *tag) + { + char buffer[150], *b, *end = buffer + sizeof(buffer); ++ char tag_buffer[30] = ""; + struct drbd_connection *connection; + struct drbd_device *device; + enum drbd_role *role = resource->role; + bool *fail_io = resource->fail_io; + int vnr; + ++ if (tag) ++ scnprintf(tag_buffer, 30, " [%s]", tag); ++ + b = buffer; + if (role[OLD] != role[NEW]) + b += scnprintf(b, end - b, "role( %s -> %s ) ", +@@ -1186,7 +1192,7 @@ static void print_state_change(struct drbd_resource *resource, const char *prefi + fail_io[NEW] ? "yes" : "no"); + if (b != buffer) { + *(b-1) = 0; +- drbd_info(resource, "%s%s\n", prefix, buffer); ++ drbd_info(resource, "%s%s%s\n", prefix, buffer, tag_buffer); + } + + for_each_connection(connection, resource) { +@@ -1205,7 +1211,7 @@ static void print_state_change(struct drbd_resource *resource, const char *prefi + + if (b != buffer) { + *(b-1) = 0; +- drbd_info(connection, "%s%s\n", prefix, buffer); ++ drbd_info(connection, "%s%s%s\n", prefix, buffer, tag_buffer); + } + } + +@@ -1225,7 +1231,7 @@ static void print_state_change(struct drbd_resource *resource, const char *prefi + have_quorum[NEW] ? "yes" : "no"); + if (b != buffer) { + *(b-1) = 0; +- drbd_info(device, "%s%s\n", prefix, buffer); ++ drbd_info(device, "%s%s%s\n", prefix, buffer, tag_buffer); + } + + for_each_peer_device(peer_device, device) { +@@ -1253,7 +1259,7 @@ static void print_state_change(struct drbd_resource *resource, const char *prefi + + if (b != buffer) { + *(b-1) = 0; +- drbd_info(peer_device, "%s%s\n", prefix, buffer); ++ drbd_info(peer_device, "%s%s%s\n", prefix, buffer, tag_buffer); + } + } + } +@@ -2543,7 +2549,7 @@ static bool should_try_become_up_to_date(struct drbd_device *device, enum drbd_d + /** + * finish_state_change - carry out actions triggered by a state change + */ +-static void finish_state_change(struct drbd_resource *resource) ++static void finish_state_change(struct drbd_resource *resource, const char *tag) + { + enum drbd_role *role = resource->role; + struct drbd_device *device; +@@ -2557,7 +2563,7 @@ static void finish_state_change(struct drbd_resource *resource) + bool unfreeze_io = false; + int vnr; + +- print_state_change(resource, ""); ++ print_state_change(resource, "", tag); + + resource_suspended[OLD] = resource_is_suspended(resource, OLD); + resource_suspended[NEW] = resource_is_suspended(resource, NEW); +@@ -3025,7 +3031,7 @@ static void abw_start_sync(struct drbd_device *device, + + if (rv) { + drbd_err(device, "Writing the bitmap failed not starting resync.\n"); +- stable_change_repl_state(peer_device, L_ESTABLISHED, CS_VERBOSE); ++ stable_change_repl_state(peer_device, L_ESTABLISHED, CS_VERBOSE, "start-sync"); + return; + } + +@@ -3039,12 +3045,13 @@ static void abw_start_sync(struct drbd_device *device, + rcu_read_unlock(); + + if (peer_device->connection->agreed_pro_version < 110) +- stable_change_repl_state(peer_device, L_WF_SYNC_UUID, CS_VERBOSE); ++ stable_change_repl_state(peer_device, L_WF_SYNC_UUID, CS_VERBOSE, ++ "start-sync"); + else +- drbd_start_resync(peer_device, L_SYNC_TARGET); ++ drbd_start_resync(peer_device, L_SYNC_TARGET, "start-sync"); + break; + case L_STARTING_SYNC_S: +- drbd_start_resync(peer_device, L_SYNC_SOURCE); ++ drbd_start_resync(peer_device, L_SYNC_SOURCE, "start-sync"); + break; + default: + break; +@@ -3531,7 +3538,7 @@ static void check_may_resume_io_after_fencing(struct drbd_state_change *state_ch + rcu_read_unlock(); + begin_state_change(resource, &irq_flags, CS_VERBOSE); + __change_io_susp_fencing(connection, false); +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "after-fencing"); + } + /* case2: The connection was established again: */ + if (all_peer_disks_connected) { +@@ -3543,7 +3550,7 @@ static void check_may_resume_io_after_fencing(struct drbd_state_change *state_ch + rcu_read_unlock(); + begin_state_change(resource, &irq_flags, CS_VERBOSE); + __change_io_susp_fencing(connection, false); +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "after-fencing"); + } + } + +@@ -4191,7 +4198,7 @@ static int w_after_state_change(struct drbd_work *w, int unused) + + begin_state_change(resource, &irq_flags, CS_VERBOSE); + resource->susp_uuid[NEW] = false; +- end_state_change(resource, &irq_flags); ++ end_state_change(resource, &irq_flags, "susp-uuid"); + } + + if (try_become_up_to_date) +@@ -4673,7 +4680,7 @@ static void twopc_phase2(struct drbd_resource *resource, + */ + static enum drbd_state_rv + change_cluster_wide_state(bool (*change)(struct change_context *, enum change_phase), +- struct change_context *context) ++ struct change_context *context, const char *tag) + { + struct drbd_resource *resource = context->resource; + unsigned long irq_flags; +@@ -4692,11 +4699,11 @@ change_cluster_wide_state(bool (*change)(struct change_context *, enum change_ph + if (local_state_change(context->flags)) { + /* Not a cluster-wide state change. */ + change(context, PH_LOCAL_COMMIT); +- return end_state_change(resource, &irq_flags); ++ return end_state_change(resource, &irq_flags, tag); + } else { + if (!change(context, PH_PREPARE)) { + /* Not a cluster-wide state change. */ +- return end_state_change(resource, &irq_flags); ++ return end_state_change(resource, &irq_flags, tag); + } + rv = try_state_change(resource); + if (rv != SS_SUCCESS) { +@@ -4704,7 +4711,7 @@ change_cluster_wide_state(bool (*change)(struct change_context *, enum change_ph + /* abort_state_change(resource, &irq_flags); */ + if (rv == SS_NOTHING_TO_DO) + resource->state_change_flags &= ~CS_VERBOSE; +- return __end_state_change(resource, &irq_flags, rv); ++ return __end_state_change(resource, &irq_flags, rv, tag); + } + /* Really a cluster-wide state change. */ + } +@@ -4720,12 +4727,12 @@ change_cluster_wide_state(bool (*change)(struct change_context *, enum change_ph + } + if (rv >= SS_SUCCESS) + change(context, PH_84_COMMIT); +- return __end_state_change(resource, &irq_flags, rv); ++ return __end_state_change(resource, &irq_flags, rv, tag); + } + + if (!expect(resource, context->flags & CS_SERIALIZE)) { + rv = SS_CW_FAILED_BY_PEER; +- return __end_state_change(resource, &irq_flags, rv); ++ return __end_state_change(resource, &irq_flags, rv, tag); + } + + rcu_read_lock(); +@@ -4740,7 +4747,7 @@ change_cluster_wide_state(bool (*change)(struct change_context *, enum change_ph + + retry: + if (current == resource->worker.task && resource->remote_state_change) +- return __end_state_change(resource, &irq_flags, SS_CONCURRENT_ST_CHG); ++ return __end_state_change(resource, &irq_flags, SS_CONCURRENT_ST_CHG, tag); + + complete_remote_state_change(resource, &irq_flags); + start_time = jiffies; +@@ -4756,7 +4763,7 @@ change_cluster_wide_state(bool (*change)(struct change_context *, enum change_ph + connection = drbd_get_connection_by_node_id(resource, context->target_node_id); + if (!connection) { + rv = SS_NEED_CONNECTION; +- return __end_state_change(resource, &irq_flags, rv); ++ return __end_state_change(resource, &irq_flags, rv, tag); + } + kref_debug_get(&connection->kref_debug, 8); + +@@ -4768,7 +4775,7 @@ change_cluster_wide_state(bool (*change)(struct change_context *, enum change_ph + + kref_debug_put(&connection->kref_debug, 8); + kref_put(&connection->kref, drbd_destroy_connection); +- return __end_state_change(resource, &irq_flags, rv); ++ return __end_state_change(resource, &irq_flags, rv, tag); + } + target_connection = connection; + +@@ -4959,7 +4966,7 @@ change_cluster_wide_state(bool (*change)(struct change_context *, enum change_ph + clear_bit(TWOPC_STATE_CHANGE_PENDING, &resource->flags); + if (rv >= SS_SUCCESS) { + change(context, PH_COMMIT); +- rv = end_state_change(resource, &irq_flags); ++ rv = end_state_change(resource, &irq_flags, tag); + if (rv < SS_SUCCESS) + drbd_err(resource, "FATAL: Local commit of already committed %u failed! \n", + request.tid); +@@ -5276,6 +5283,7 @@ static bool do_change_role(struct change_context *context, enum change_phase pha + enum drbd_state_rv change_role(struct drbd_resource *resource, + enum drbd_role role, + enum chg_state_flags flags, ++ const char *tag, + const char **err_str) + { + struct change_context role_context = { +@@ -5310,7 +5318,7 @@ enum drbd_state_rv change_role(struct drbd_resource *resource, + } + role_context.change_local_state_last = true; + } +- rv = change_cluster_wide_state(do_change_role, &role_context); ++ rv = change_cluster_wide_state(do_change_role, &role_context, tag); + out: + if (got_state_sem) + up(&resource->state_sem); +@@ -5330,7 +5338,7 @@ enum drbd_state_rv change_io_susp_user(struct drbd_resource *resource, + + begin_state_change(resource, &irq_flags, flags); + __change_io_susp_user(resource, value); +- return end_state_change(resource, &irq_flags); ++ return end_state_change(resource, &irq_flags, value ? "suspend-io" : "resume-io"); + } + + void __change_io_susp_no_data(struct drbd_resource *resource, bool value) +@@ -5465,7 +5473,7 @@ enum drbd_state_rv twopc_after_lost_peer(struct drbd_resource *resource, + /* The other nodes get the request for an empty state change. I.e. they + will agree to this change request. At commit time we know where to + go from the D_CONSISTENT, since we got the primary mask. */ +- return change_cluster_wide_state(do_twopc_after_lost_peer, &context); ++ return change_cluster_wide_state(do_twopc_after_lost_peer, &context, "lost-peer"); + } + + static bool do_change_disk_state(struct change_context *context, enum change_phase phase) +@@ -5496,6 +5504,7 @@ static bool do_change_disk_state(struct change_context *context, enum change_pha + enum drbd_state_rv change_disk_state(struct drbd_device *device, + enum drbd_disk_state disk_state, + enum chg_state_flags flags, ++ const char *tag, + const char **err_str) + { + struct change_disk_state_context disk_state_context = { +@@ -5513,7 +5522,7 @@ enum drbd_state_rv change_disk_state(struct drbd_device *device, + }; + + return change_cluster_wide_state(do_change_disk_state, +- &disk_state_context.context); ++ &disk_state_context.context, tag); + } + + void __change_cstate(struct drbd_connection *connection, enum drbd_conn_state cstate) +@@ -5683,11 +5692,11 @@ static bool do_change_cstate(struct change_context *context, enum change_phase p + * peer disks depending on the fencing policy. This cannot easily be split + * into two state changes. + */ +-enum drbd_state_rv change_cstate_es(struct drbd_connection *connection, ++enum drbd_state_rv change_cstate_tag(struct drbd_connection *connection, + enum drbd_conn_state cstate, + enum chg_state_flags flags, +- const char **err_str +- ) ++ const char *tag, ++ const char **err_str) + { + struct change_cstate_context cstate_context = { + .context = { +@@ -5717,7 +5726,7 @@ enum drbd_state_rv change_cstate_es(struct drbd_connection *connection, + if (!(flags & CS_HARD)) + cstate_context.context.flags |= CS_SERIALIZE; + +- return change_cluster_wide_state(do_change_cstate, &cstate_context.context); ++ return change_cluster_wide_state(do_change_cstate, &cstate_context.context, tag); + } + + void __change_peer_role(struct drbd_connection *connection, enum drbd_role peer_role) +@@ -5759,7 +5768,8 @@ static bool do_change_repl_state(struct change_context *context, enum change_pha + + enum drbd_state_rv change_repl_state(struct drbd_peer_device *peer_device, + enum drbd_repl_state new_repl_state, +- enum chg_state_flags flags) ++ enum chg_state_flags flags, ++ const char *tag) + { + struct change_repl_context repl_context = { + .context = { +@@ -5776,15 +5786,16 @@ enum drbd_state_rv change_repl_state(struct drbd_peer_device *peer_device, + if (new_repl_state == L_WF_BITMAP_S || new_repl_state == L_VERIFY_S) + repl_context.context.change_local_state_last = true; + +- return change_cluster_wide_state(do_change_repl_state, &repl_context.context); ++ return change_cluster_wide_state(do_change_repl_state, &repl_context.context, tag); + } + + enum drbd_state_rv stable_change_repl_state(struct drbd_peer_device *peer_device, + enum drbd_repl_state repl_state, +- enum chg_state_flags flags) ++ enum chg_state_flags flags, ++ const char *tag) + { + return stable_state_change(peer_device->device->resource, +- change_repl_state(peer_device, repl_state, flags)); ++ change_repl_state(peer_device, repl_state, flags, tag)); + } + + void __change_peer_disk_state(struct drbd_peer_device *peer_device, enum drbd_disk_state disk_state) +@@ -5807,14 +5818,15 @@ void __downgrade_peer_disk_states(struct drbd_connection *connection, enum drbd_ + + enum drbd_state_rv change_peer_disk_state(struct drbd_peer_device *peer_device, + enum drbd_disk_state disk_state, +- enum chg_state_flags flags) ++ enum chg_state_flags flags, ++ const char *tag) + { + struct drbd_resource *resource = peer_device->device->resource; + unsigned long irq_flags; + + begin_state_change(resource, &irq_flags, flags); + __change_peer_disk_state(peer_device, disk_state); +- return end_state_change(resource, &irq_flags); ++ return end_state_change(resource, &irq_flags, tag); + } + + void __change_resync_susp_user(struct drbd_peer_device *peer_device, +@@ -5832,7 +5844,7 @@ enum drbd_state_rv change_resync_susp_user(struct drbd_peer_device *peer_device, + + begin_state_change(resource, &irq_flags, flags); + __change_resync_susp_user(peer_device, value); +- return end_state_change(resource, &irq_flags); ++ return end_state_change(resource, &irq_flags, value ? "pause-sync" : "resume-sync"); + } + + void __change_resync_susp_peer(struct drbd_peer_device *peer_device, +diff --git a/drbd/drbd_state.h b/drbd/drbd_state.h +index 6942f85123dd..952dea156697 100644 +--- a/drbd/drbd_state.h ++++ b/drbd/drbd_state.h +@@ -56,12 +56,13 @@ extern void state_change_lock(struct drbd_resource *, unsigned long *, enum chg_ + extern void state_change_unlock(struct drbd_resource *, unsigned long *); + + extern void begin_state_change(struct drbd_resource *, unsigned long *, enum chg_state_flags); +-extern enum drbd_state_rv end_state_change(struct drbd_resource *, unsigned long *); ++extern enum drbd_state_rv end_state_change(struct drbd_resource *resource, unsigned long *irq_flags, ++ const char *tag); + extern void abort_state_change(struct drbd_resource *, unsigned long *); + extern void abort_state_change_locked(struct drbd_resource *resource); + + extern void begin_state_change_locked(struct drbd_resource *, enum chg_state_flags); +-extern enum drbd_state_rv end_state_change_locked(struct drbd_resource *); ++extern enum drbd_state_rv end_state_change_locked(struct drbd_resource *resource, const char *tag); + + extern void clear_remote_state_change(struct drbd_resource *resource); + extern void __clear_remote_state_change(struct drbd_resource *resource); +@@ -89,7 +90,11 @@ extern enum drbd_state_rv nested_twopc_request(struct drbd_resource *res, struct + extern bool drbd_twopc_between_peer_and_me(struct drbd_connection *connection); + extern bool cluster_wide_reply_ready(struct drbd_resource *); + +-extern enum drbd_state_rv change_role(struct drbd_resource *, enum drbd_role, enum chg_state_flags, const char **); ++extern enum drbd_state_rv change_role(struct drbd_resource *resource, ++ enum drbd_role role, ++ enum chg_state_flags flags, ++ const char *tag, ++ const char **err_str); + + extern void __change_io_susp_user(struct drbd_resource *, bool); + extern enum drbd_state_rv change_io_susp_user(struct drbd_resource *, bool, enum chg_state_flags); +@@ -99,27 +104,44 @@ extern void __change_io_susp_quorum(struct drbd_resource *, bool); + + extern void __change_disk_state(struct drbd_device *, enum drbd_disk_state); + extern void __downgrade_disk_states(struct drbd_resource *, enum drbd_disk_state); +-extern enum drbd_state_rv change_disk_state(struct drbd_device *, enum drbd_disk_state, enum chg_state_flags, const char **); ++extern enum drbd_state_rv change_disk_state(struct drbd_device *device, ++ enum drbd_disk_state disk_state, ++ enum chg_state_flags flags, ++ const char *tag, ++ const char **err_str); + + extern void __change_cstate(struct drbd_connection *, enum drbd_conn_state); +-extern enum drbd_state_rv change_cstate_es(struct drbd_connection *, enum drbd_conn_state, enum chg_state_flags, const char **); ++extern enum drbd_state_rv change_cstate_tag(struct drbd_connection *connection, ++ enum drbd_conn_state cstate, ++ enum chg_state_flags flags, ++ const char *tag, ++ const char **err_str); + static inline enum drbd_state_rv change_cstate(struct drbd_connection *connection, + enum drbd_conn_state cstate, + enum chg_state_flags flags) + { +- return change_cstate_es(connection, cstate, flags, NULL); ++ return change_cstate_tag(connection, cstate, flags, NULL, NULL); + } + + extern void __change_peer_role(struct drbd_connection *, enum drbd_role); + + extern void __change_repl_state(struct drbd_peer_device *, enum drbd_repl_state); +-extern enum drbd_state_rv change_repl_state(struct drbd_peer_device *, enum drbd_repl_state, enum chg_state_flags); +-extern enum drbd_state_rv stable_change_repl_state(struct drbd_peer_device *, enum drbd_repl_state, enum chg_state_flags); ++extern enum drbd_state_rv change_repl_state(struct drbd_peer_device *peer_device, ++ enum drbd_repl_state new_repl_state, ++ enum chg_state_flags flags, ++ const char *tag); ++extern enum drbd_state_rv stable_change_repl_state(struct drbd_peer_device *peer_device, ++ enum drbd_repl_state repl_state, ++ enum chg_state_flags flags, ++ const char *tag); + + extern void __change_peer_disk_state(struct drbd_peer_device *, enum drbd_disk_state); + extern void __downgrade_peer_disk_states(struct drbd_connection *, enum drbd_disk_state); + extern void __outdate_myself(struct drbd_resource *resource); +-extern enum drbd_state_rv change_peer_disk_state(struct drbd_peer_device *, enum drbd_disk_state, enum chg_state_flags); ++extern enum drbd_state_rv change_peer_disk_state(struct drbd_peer_device *peer_device, ++ enum drbd_disk_state disk_state, ++ enum chg_state_flags flags, ++ const char *tag); + + enum drbd_state_rv twopc_after_lost_peer(struct drbd_resource *resource, enum chg_state_flags); + +-- +2.35.3 + diff --git a/0015-compat-block-use-the-holder-as-indication-for-exclus.patch b/0015-compat-block-use-the-holder-as-indication-for-exclus.patch new file mode 100644 index 0000000..83881d6 --- /dev/null +++ b/0015-compat-block-use-the-holder-as-indication-for-exclus.patch @@ -0,0 +1,202 @@ +From 3b9fcc2cfaa32766724f371cc2054e057adbc425 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Moritz=20=22WanzenBug=22=20Wanzenb=C3=B6ck?= + +Date: Mon, 11 Sep 2023 13:36:07 +0200 +Subject: [PATCH 15/20] compat: block: use the holder as indication for + exclusive opens + +See also upstream Linux kernel commit +2736e8eeb0cc ("block: use the holder as indication for exclusive opens") +Original message: + +The current interface for exclusive opens is rather confusing as it +requires both the FMODE_EXCL flag and a holder. Remove the need to pass +FMODE_EXCL and just key off the exclusive open off a non-NULL holder. + +For blkdev_put this requires adding the holder argument, which provides +better debug checking that only the holder actually releases the hold, +but at the same time allows removing the now superfluous mode argument. +--- + .../cocci/blkdev_put__no_has_holder.cocci | 38 +++++++++++++++++++ + drbd/drbd-kernel-compat/gen_patch_names.c | 3 ++ + .../tests/blkdev_put_has_holder.c | 17 +++++++++ + drbd/drbd_nl.c | 28 ++++++++------ + 4 files changed, 75 insertions(+), 11 deletions(-) + create mode 100644 drbd/drbd-kernel-compat/cocci/blkdev_put__no_has_holder.cocci + create mode 100644 drbd/drbd-kernel-compat/tests/blkdev_put_has_holder.c + +diff --git a/drbd/drbd-kernel-compat/cocci/blkdev_put__no_has_holder.cocci b/drbd/drbd-kernel-compat/cocci/blkdev_put__no_has_holder.cocci +new file mode 100644 +index 000000000000..c903bc2d529c +--- /dev/null ++++ b/drbd/drbd-kernel-compat/cocci/blkdev_put__no_has_holder.cocci +@@ -0,0 +1,38 @@ ++@@ ++expression path, mode; ++@@ ++ blkdev_get_by_path( ++ path, ++- mode, +++ mode | FMODE_EXCL, ++ ... ++ ) ++ ++@@ ++expression bdev, holder; ++@@ ++ blkdev_put( ++ bdev, ++- holder +++ FMODE_READ | FMODE_WRITE | FMODE_EXCL ++ ) ++ ++@@ ++identifier device, bdev, holder, do_bd_unlink; ++@@ ++ void close_backing_dev( ++ struct drbd_device *device, ++ struct block_device *bdev, ++- void *holder, ++ bool do_bd_unlink ++ ) { ... } ++ ++@@ ++expression device, bdev, holder, do_bd_unlink; ++@@ ++ close_backing_dev( ++ device, ++ bdev, ++- holder, ++ do_bd_unlink ++ ) +diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c +index 6e4f06d9a3a7..4761c1ef7d0c 100644 +--- a/drbd/drbd-kernel-compat/gen_patch_names.c ++++ b/drbd/drbd-kernel-compat/gen_patch_names.c +@@ -562,6 +562,9 @@ int main(int argc, char **argv) + patch(1, "block_device_operations_open", true, false, + COMPAT_BLOCK_DEVICE_OPERATIONS_OPEN_TAKES_GENDISK, "takes_gendisk"); + ++ patch(1, "blkdev_put", true, false, ++ COMPAT_BLKDEV_PUT_HAS_HOLDER, "has_holder"); ++ + /* #define BLKDEV_ISSUE_ZEROOUT_EXPORTED */ + /* #define BLKDEV_ZERO_NOUNMAP */ + +diff --git a/drbd/drbd-kernel-compat/tests/blkdev_put_has_holder.c b/drbd/drbd-kernel-compat/tests/blkdev_put_has_holder.c +new file mode 100644 +index 000000000000..d5f0c5dd0355 +--- /dev/null ++++ b/drbd/drbd-kernel-compat/tests/blkdev_put_has_holder.c +@@ -0,0 +1,17 @@ ++/* { "version": "v6.5-rc1", "commit": "ae220766d87cd6799dbf918fea10613ae14c0654", "comment": "block: remove the unused mode argument to ->release", "author": "Christoph Hellwig ", "date": "Thu Jun 8 13:02:37 2023 +0200" } */ ++#include ++ ++#ifndef __same_type ++# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) ++#endif ++ ++void foo_blkdev_put(struct block_device *bdev, void *holder) ++{ ++} ++ ++ ++void foo(void) ++{ ++ BUILD_BUG_ON(!(__same_type(&blkdev_put, &foo_blkdev_put))); ++} ++ +diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c +index b7e9e43312f9..8c968cf252ca 100644 +--- a/drbd/drbd_nl.c ++++ b/drbd/drbd_nl.c +@@ -2536,13 +2536,13 @@ bool want_bitmap(struct drbd_peer_device *peer_device) + } + + static void close_backing_dev(struct drbd_device *device, struct block_device *bdev, +- bool do_bd_unlink) ++ void *holder, bool do_bd_unlink) + { + if (!bdev) + return; + if (do_bd_unlink) + bd_unlink_disk_holder(bdev, device->vdisk); +- blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL); ++ blkdev_put(bdev, holder); + } + + void drbd_backing_dev_free(struct drbd_device *device, struct drbd_backing_dev *ldev) +@@ -2552,8 +2552,11 @@ void drbd_backing_dev_free(struct drbd_device *device, struct drbd_backing_dev * + + drbd_dax_close(ldev); + +- close_backing_dev(device, ldev->md_bdev, ldev->md_bdev != ldev->backing_bdev); +- close_backing_dev(device, ldev->backing_bdev, true); ++ close_backing_dev(device, ++ ldev->md_bdev, ++ ldev->md.meta_dev_idx < 0 ? (void *)device : (void *)drbd_m_holder, ++ ldev->md_bdev != ldev->backing_bdev); ++ close_backing_dev(device, ldev->backing_bdev, device, true); + + kfree(ldev->disk_conf); + kfree(ldev); +@@ -2563,7 +2566,7 @@ static struct block_device *open_backing_dev(struct drbd_device *device, + const char *bdev_path, void *claim_ptr) + { + struct block_device *bdev = blkdev_get_by_path(bdev_path, +- FMODE_READ | FMODE_WRITE | FMODE_EXCL, ++ FMODE_READ | FMODE_WRITE, + claim_ptr, NULL); + if (IS_ERR(bdev)) { + drbd_err(device, "open(\"%s\") failed with %ld\n", +@@ -2588,6 +2591,7 @@ static int open_backing_devices(struct drbd_device *device, + struct drbd_backing_dev *nbc) + { + struct block_device *bdev; ++ void *meta_claim_ptr; + int err; + + bdev = open_backing_dev(device, new_disk_conf->backing_dev, device); +@@ -2597,12 +2601,17 @@ static int open_backing_devices(struct drbd_device *device, + err = link_backing_dev(device, new_disk_conf->backing_dev, bdev); + if (err) { + /* close without unlinking; otherwise error path will try to unlink */ +- close_backing_dev(device, bdev, false); ++ close_backing_dev(device, bdev, device, false); + return ERR_OPEN_DISK; + } + + nbc->backing_bdev = bdev; + ++ /* meta_claim_ptr: device, if claimed exclusively; shared drbd_m_holder, ++ * if potentially shared with other drbd minors ++ */ ++ meta_claim_ptr = (new_disk_conf->meta_dev_idx < 0) ? ++ (void *)device : (void *)drbd_m_holder; + /* + * meta_dev_idx >= 0: external fixed size, possibly multiple + * drbd sharing one meta device. TODO in that case, paranoia +@@ -2611,10 +2620,7 @@ static int open_backing_devices(struct drbd_device *device, + * should check it for you already; but if you don't, or + * someone fooled it, we need to double check here) + */ +- bdev = open_backing_dev(device, new_disk_conf->meta_dev, +- /* claim ptr: device, if claimed exclusively; shared drbd_m_holder, +- * if potentially shared with other drbd minors */ +- (new_disk_conf->meta_dev_idx < 0) ? (void*)device : (void*)drbd_m_holder); ++ bdev = open_backing_dev(device, new_disk_conf->meta_dev, meta_claim_ptr); + if (IS_ERR(bdev)) + return ERR_OPEN_MD_DISK; + +@@ -2624,7 +2630,7 @@ static int open_backing_devices(struct drbd_device *device, + err = link_backing_dev(device, new_disk_conf->meta_dev, bdev); + if (err) { + /* close without unlinking; otherwise error path will try to unlink */ +- close_backing_dev(device, bdev, false); ++ close_backing_dev(device, bdev, meta_claim_ptr, false); + return ERR_OPEN_MD_DISK; + } + } +-- +2.35.3 + diff --git a/0018-drbd-rework-autopromote.patch b/0018-drbd-rework-autopromote.patch new file mode 100644 index 0000000..dab770a --- /dev/null +++ b/0018-drbd-rework-autopromote.patch @@ -0,0 +1,185 @@ +From e3ef0e229a6ae88346164d1507697ae1b397cdf9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Moritz=20=22WanzenBug=22=20Wanzenb=C3=B6ck?= + +Date: Tue, 12 Sep 2023 10:17:08 +0200 +Subject: [PATCH 18/20] drbd: rework autopromote + +With upstream commit ae220766d87c we lost the ability to keep separate +counts for RW and RO openers. Instead, we keep track of openers using a +single count, and a flag indicating if the device was opened RW once. + +Once a device was opened RW, it will stay "writable" for DRBD, until all +openers are gone. This should offer a good compromise between keeping +the old auto-promote behaviour, and the changed device interface. +--- + drbd/drbd_int.h | 3 ++- + drbd/drbd_main.c | 38 +++++++++++++++++++++----------------- + drbd/drbd_nl.c | 9 +++++---- + drbd/drbd_state.c | 7 ++++--- + 4 files changed, 32 insertions(+), 25 deletions(-) + +diff --git a/drbd/drbd_int.h b/drbd/drbd_int.h +index b705f26e71a4..cf593c09cda1 100644 +--- a/drbd/drbd_int.h ++++ b/drbd/drbd_int.h +@@ -1399,7 +1399,8 @@ struct drbd_device { + + struct drbd_bitmap *bitmap; + +- int open_rw_cnt, open_ro_cnt; ++ int open_cnt; ++ bool writable; + /* FIXME clean comments, restructure so it is more obvious which + * members are protected by what */ + +diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c +index 4b0b967c2c97..bb05b2215dfb 100644 +--- a/drbd/drbd_main.c ++++ b/drbd/drbd_main.c +@@ -2579,10 +2579,9 @@ static enum ioc_rv inc_open_count(struct drbd_device *device, fmode_t mode) + r = IOC_ABORT; + else if (!resource->remote_state_change) { + r = IOC_OK; ++ device->open_cnt++; + if (mode & FMODE_WRITE) +- device->open_rw_cnt++; +- else +- device->open_ro_cnt++; ++ device->writable = true; + } + read_unlock_irq(&resource->state_rwlock); + +@@ -2756,8 +2755,10 @@ void drbd_open_counts(struct drbd_resource *resource, int *rw_count_ptr, int *ro + + rcu_read_lock(); + idr_for_each_entry(&resource->devices, device, vnr) { +- rw_count += device->open_rw_cnt; +- ro_count += device->open_ro_cnt; ++ if (device->writable) ++ rw_count += device->open_cnt; ++ else ++ ro_count += device->open_cnt; + } + rcu_read_unlock(); + *rw_count_ptr = rw_count; +@@ -2825,33 +2826,35 @@ static void drbd_release(struct gendisk *gd, fmode_t mode) + { + struct drbd_device *device = gd->private_data; + struct drbd_resource *resource = device->resource; ++ bool was_writable = device->writable; + int open_rw_cnt, open_ro_cnt; + + mutex_lock(&resource->open_release); +- if (mode & FMODE_WRITE) +- device->open_rw_cnt--; +- else +- device->open_ro_cnt--; ++ device->open_cnt--; + + drbd_open_counts(resource, &open_rw_cnt, &open_ro_cnt); + +- /* last one to close will be responsible for write-out of all dirty pages */ +- if (mode & FMODE_WRITE && device->open_rw_cnt == 0) ++ /* last one to close will be responsible for write-out of all dirty pages. ++ * We also reset the writable flag for this device here: later code may ++ * check if the device is still opened for writes to determine things ++ * like auto-demote. ++ */ ++ if (was_writable && device->open_cnt == 0) { + drbd_fsync_device(device); ++ device->writable = false; ++ } + + if (open_ro_cnt == 0) + wake_up_all(&resource->state_wait); + +- if (test_bit(UNREGISTERED, &device->flags) && +- device->open_rw_cnt == 0 && device->open_ro_cnt == 0 && ++ if (test_bit(UNREGISTERED, &device->flags) && device->open_cnt == 0 && + !test_and_set_bit(DESTROYING_DEV, &device->flags)) + call_rcu(&device->rcu, drbd_reclaim_device); + + if (resource->res_opts.auto_promote) { + enum drbd_state_rv rv; + +- if (mode & FMODE_WRITE && +- open_rw_cnt == 0 && ++ if (was_writable && open_rw_cnt == 0 && + resource->role[NOW] == R_PRIMARY && + !test_bit(EXPLICIT_PRIMARY, &resource->flags)) { + rv = drbd_set_role(resource, R_SECONDARY, false, "auto-demote", NULL); +@@ -2869,9 +2872,10 @@ static void drbd_release(struct gendisk *gd, fmode_t mode) + end_state_change(resource, &irq_flags, "release"); + } + +- /* if the open counts are 0, we free the whole list, otherwise we remove the specific pid */ ++ /* if the open count is 0, we free the whole list, otherwise we remove the specific pid */ + prune_or_free_openers(device, +- (open_ro_cnt == 0 && open_rw_cnt == 0) ? 0 : task_pid_nr(current)); ++ (open_ro_cnt == 0 && open_rw_cnt == 0) ? ++ 0 : task_pid_nr(current)); + + mutex_unlock(&resource->open_release); + +diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c +index b0a1e6fa46f1..71ed4272614e 100644 +--- a/drbd/drbd_nl.c ++++ b/drbd/drbd_nl.c +@@ -4541,8 +4541,10 @@ int drbd_open_ro_count(struct drbd_resource *resource) + int vnr, open_ro_cnt = 0; + + read_lock_irq(&resource->state_rwlock); +- idr_for_each_entry(&resource->devices, device, vnr) +- open_ro_cnt += device->open_ro_cnt; ++ idr_for_each_entry(&resource->devices, device, vnr) { ++ if (!device->writable) ++ open_ro_cnt += device->open_cnt; ++ } + read_unlock_irq(&resource->state_rwlock); + + return open_ro_cnt; +@@ -6394,8 +6396,7 @@ static enum drbd_ret_code adm_del_minor(struct drbd_device *device) + notify_device_state(NULL, 0, device, NULL, NOTIFY_DESTROY); + mutex_unlock(¬ification_mutex); + +- if (device->open_ro_cnt == 0 && device->open_rw_cnt == 0 && +- !test_and_set_bit(DESTROYING_DEV, &device->flags)) ++ if (device->open_cnt == 0 && !test_and_set_bit(DESTROYING_DEV, &device->flags)) + call_rcu(&device->rcu, drbd_reclaim_device); + + return ret; +diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c +index 22cd134be962..fa70507df425 100644 +--- a/drbd/drbd_state.c ++++ b/drbd/drbd_state.c +@@ -1634,7 +1634,7 @@ handshake_found: + return SS_TWO_PRIMARIES; + if (!fail_io[NEW]) { + idr_for_each_entry(&resource->devices, device, vnr) { +- if (device->open_ro_cnt) ++ if (!device->writable && device->open_cnt) + return SS_PRIMARY_READER; + /* + * One might be tempted to add "|| open_rw_cont" here. +@@ -1661,7 +1661,7 @@ handshake_found: + (disk_state[OLD] > D_DETACHING && disk_state[NEW] == D_DETACHING))) + return SS_IN_TRANSIENT_STATE; + +- if (role[OLD] == R_PRIMARY && role[NEW] == R_SECONDARY && device->open_rw_cnt && ++ if (role[OLD] == R_PRIMARY && role[NEW] == R_SECONDARY && device->writable && + !(resource->state_change_flags & CS_FS_IGN_OPENERS)) + return SS_DEVICE_IN_USE; + +@@ -1693,7 +1693,8 @@ handshake_found: + return SS_NO_UP_TO_DATE_DISK; + + /* Prevent detach or disconnect while held open read only */ +- if (device->open_ro_cnt && any_disk_up_to_date[OLD] && !any_disk_up_to_date[NEW]) ++ if (!device->writable && device->open_cnt && ++ any_disk_up_to_date[OLD] && !any_disk_up_to_date[NEW]) + return SS_NO_UP_TO_DATE_DISK; + + if (disk_state[NEW] == D_NEGOTIATING) +-- +2.35.3 + diff --git a/0019-compat-block-remove-the-unused-mode-argument-to-rele.patch b/0019-compat-block-remove-the-unused-mode-argument-to-rele.patch new file mode 100644 index 0000000..9f40f7c --- /dev/null +++ b/0019-compat-block-remove-the-unused-mode-argument-to-rele.patch @@ -0,0 +1,107 @@ +From bf287c15359c4495a706ca270e7dcab4c2d6ebcc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Moritz=20=22WanzenBug=22=20Wanzenb=C3=B6ck?= + +Date: Tue, 12 Sep 2023 15:27:01 +0200 +Subject: [PATCH 19/20] compat: block: remove the unused mode argument to + ->release + +See also upstream Linux kernel commit +ae220766d87c ("block: remove the unused mode argument to ->release") + +Original message: + +The mode argument to the ->release block_device_operation is never used, +so remove it. +--- + ...ions_release__no_takes_single_argument.cocci | 17 +++++++++++++++++ + drbd/drbd-kernel-compat/gen_patch_names.c | 3 +++ + ...e_operations_release_takes_single_argument.c | 7 +++++++ + drbd/drbd_main.c | 6 +++--- + 4 files changed, 30 insertions(+), 3 deletions(-) + create mode 100644 drbd/drbd-kernel-compat/cocci/block_device_operations_release__no_takes_single_argument.cocci + create mode 100644 drbd/drbd-kernel-compat/tests/block_device_operations_release_takes_single_argument.c + +diff --git a/drbd/drbd-kernel-compat/cocci/block_device_operations_release__no_takes_single_argument.cocci b/drbd/drbd-kernel-compat/cocci/block_device_operations_release__no_takes_single_argument.cocci +new file mode 100644 +index 000000000000..b0a0ee9eef39 +--- /dev/null ++++ b/drbd/drbd-kernel-compat/cocci/block_device_operations_release__no_takes_single_argument.cocci +@@ -0,0 +1,17 @@ ++@@ ++identifier gd; ++fresh identifier mode = "" ## "mode"; ++@@ ++ drbd_release( ++ struct gendisk *gd +++ , fmode_t mode ++ ) { ... } ++ ++@@ ++symbol drbd_release; ++expression gd; ++@@ ++ drbd_release( ++ gd +++ , 0 ++ ) +diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c +index 4761c1ef7d0c..608be8b4f099 100644 +--- a/drbd/drbd-kernel-compat/gen_patch_names.c ++++ b/drbd/drbd-kernel-compat/gen_patch_names.c +@@ -565,6 +565,9 @@ int main(int argc, char **argv) + patch(1, "blkdev_put", true, false, + COMPAT_BLKDEV_PUT_HAS_HOLDER, "has_holder"); + ++ patch(1, "block_device_operations_release", true, false, ++ COMPAT_BLOCK_DEVICE_OPERATIONS_RELEASE_TAKES_SINGLE_ARGUMENT, "takes_single_argument"); ++ + /* #define BLKDEV_ISSUE_ZEROOUT_EXPORTED */ + /* #define BLKDEV_ZERO_NOUNMAP */ + +diff --git a/drbd/drbd-kernel-compat/tests/block_device_operations_release_takes_single_argument.c b/drbd/drbd-kernel-compat/tests/block_device_operations_release_takes_single_argument.c +new file mode 100644 +index 000000000000..d51c863e359a +--- /dev/null ++++ b/drbd/drbd-kernel-compat/tests/block_device_operations_release_takes_single_argument.c +@@ -0,0 +1,7 @@ ++/* { "version": "v6.5-rc1", "commit": "ae220766d87cd6799dbf918fea10613ae14c0654", "comment": "block: remove the unused mode argument to ->release", "author": "Christoph Hellwig ", "date": "Thu Jun 8 13:02:37 2023 +0200" } */ ++#include ++ ++void foo(struct block_device_operations *ops, struct gendisk *gd) ++{ ++ ops->release(gd); ++} +diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c +index bb05b2215dfb..1864861db21d 100644 +--- a/drbd/drbd_main.c ++++ b/drbd/drbd_main.c +@@ -53,7 +53,7 @@ + #include "drbd_dax_pmem.h" + + static int drbd_open(struct gendisk *gd, fmode_t mode); +-static void drbd_release(struct gendisk *gd, fmode_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); + static int flush_send_buffer(struct drbd_connection *connection, enum drbd_stream drbd_stream); +@@ -2740,7 +2740,7 @@ out: + + mutex_unlock(&resource->open_release); + if (err) { +- drbd_release(gd, mode); ++ drbd_release(gd); + if (err == -EAGAIN && !(mode & FMODE_NDELAY)) + err = -EMEDIUMTYPE; + } +@@ -2822,7 +2822,7 @@ void drbd_fsync_device(struct drbd_device *device) + drbd_flush_peer_acks(resource); + } + +-static void drbd_release(struct gendisk *gd, fmode_t mode) ++static void drbd_release(struct gendisk *gd) + { + struct drbd_device *device = gd->private_data; + struct drbd_resource *resource = device->resource; +-- +2.35.3 + diff --git a/0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch b/0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch new file mode 100644 index 0000000..82ef213 --- /dev/null +++ b/0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch @@ -0,0 +1,183 @@ +From 2d3c3fd6546174a0452c9bbd64d4f4193c0c39e2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Moritz=20WanzenBug=20Wanzenb=C3=B6ck?= + +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 ", "date": "Thu Jun 8 13:02:55 2023 +0200" } */ ++#include ++ ++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 + diff --git a/0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch b/0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch new file mode 100644 index 0000000..490b1e3 --- /dev/null +++ b/0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch @@ -0,0 +1,96 @@ +From 1412792a443ddc696fd1c8981a6cc544272f54bf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Moritz=20WanzenBug=20Wanzenb=C3=B6ck?= + +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 ", "date": "Mon Aug 14 14:47:16 2023 -0700" } */ ++#include ++ ++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 + diff --git a/Module.supported b/Module.supported new file mode 100644 index 0000000..36f0225 --- /dev/null +++ b/Module.supported @@ -0,0 +1,2 @@ +updates/drbd.ko +updates/drbd_transport_tcp.ko diff --git a/_service b/_service new file mode 100644 index 0000000..67567ef --- /dev/null +++ b/_service @@ -0,0 +1,18 @@ + + + git@github.com:LINBIT/drbd-9.0.git + git + drbd + 9.0.30~1+git.%h + drbd-9.0 + + + + *drbd*.tar + bz2 + + + + drbd + + diff --git a/bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch b/bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch new file mode 100644 index 0000000..d489ea1 --- /dev/null +++ b/bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch @@ -0,0 +1,13 @@ +diff -Naur drbd-9.0.7rc1+git.093821cd.orig/drbd/drbd_receiver.c drbd-9.0.7rc1+git.093821cd/drbd/drbd_receiver.c +--- drbd-9.0.7rc1+git.093821cd.orig/drbd/drbd_receiver.c 2017-03-24 16:55:42.169376092 +0800 ++++ drbd-9.0.7rc1+git.093821cd/drbd/drbd_receiver.c 2017-03-24 16:56:51.137239174 +0800 +@@ -6240,7 +6240,8 @@ + /* if peer_state changes to connected at the same time, + * it explicitly notifies us that it finished resync. + * Maybe we should finish it up, too? */ +- else if (peer_state.conn == L_ESTABLISHED) { ++ else if (peer_state.conn == L_ESTABLISHED && ++ peer_disk_state > D_NEGOTIATING) { + bool finish_now = false; + + if (old_peer_state.conn == L_WF_BITMAP_S) { diff --git a/bsc-1216666-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch b/bsc-1216666-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch new file mode 100644 index 0000000..244b785 --- /dev/null +++ b/bsc-1216666-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch @@ -0,0 +1,107 @@ +From 6fd35546c2d2afd10afe04ab9cdf4ac9ca0b3e94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Moritz=20=22WanzenBug=22=20Wanzenb=C3=B6ck?= + +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 228386f448a5..e4a65a3c451e 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 ", "date": "Fri Jun 23 23:55:12 2023 +0100" } */ ++#include ++ ++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.35.3 + diff --git a/drbd-9.1.16.tar.gz b/drbd-9.1.16.tar.gz new file mode 100644 index 0000000..e01fee3 --- /dev/null +++ b/drbd-9.1.16.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ad99353dbae62acc1bf4ef32fa8ca317e6657138e02c009e3d4cf42bfb465fb +size 1332576 diff --git a/drbd.changes b/drbd.changes new file mode 100644 index 0000000..641b8d4 --- /dev/null +++ b/drbd.changes @@ -0,0 +1,2550 @@ +------------------------------------------------------------------ +Wed Jan 10 01:55:00 UTC 2024 - Heming Zhao + +- drbd fails to build with the latest 6.4 kernel of the week (bsc#1218658) + * Add patch + + 0006-drbd-log-numeric-value-of-drbd_state_rv-as-well-as-s.patch + + 0011-compat-block-pass-a-gendisk-to-open.patch + + 0013-drbd-remove-unused-extern-for-conn_try_outdate_peer.patch + + 0014-drbd-include-source-of-state-change-in-log.patch + + 0015-compat-block-use-the-holder-as-indication-for-exclus.patch + + 0018-drbd-rework-autopromote.patch + + 0019-compat-block-remove-the-unused-mode-argument-to-rele.patch + + 0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch + + 0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch + +------------------------------------------------------------------ +Wed Nov 8 07:47:00 UTC 2023 - Heming Zhao + +- drbd failed to build after 15sp6/dolomit updated kernel (bsc#1216666) + * Add patch + + bsc-1216666-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch + +------------------------------------------------------------------ +Tue Oct 31 10:16:00 UTC 2023 - Heming Zhao + +- drbd failed to build after 15sp6/dolomit updated kernel (bsc#1216666) + * Add patch + + 0008-compat-block-introduce-holder-ops.patch + +------------------------------------------------------------------ +Mon Sep 04 11:35:00 UTC 2023 - Heming Zhao + +- Update DRBD version from 9.0.30+ to 9.1.16 (PED-6362) + + * 9.1.16 (api:genl2/proto:86-121/transport:18) + * shorten times DRBD keeps IRQs on one CPU disabled. Could lead + to connection interruption under specific conditions + * fix a corner case where resync did not start after resync-pause + state flapped + * fix online adding of volumes/minors to an already connected resource + * fix a possible split-brain situation with quorum enabled with + ping-timeout set to (unusual) high value + * fix a locking problem that could lead to kernel OOPS + * ensure resync can continue (bitmap-based) after interruption + also when it started as a full-resync first + * correctly handle meta-data when forgetting diskless peers + * fix a possibility of getting a split-brain although quorum enabled + * correctly propagate UUIDs after resync following a resize operation. + Consequence could be a full resync instead of a bitmap-based one + * fix a rare race condition that can cause a drbd device to end up + with WFBitMapS/Established replication states + + * 9.1.15 (api:genl2/proto:86-121/transport:18) + * fix how flush requests are marked when submitted to the Linux IO + stack on the secondary node + * when establishing a connection failed with a two-pc timeout, a + receiver thread deadlocked, causing drbdsetup calls to block on + that resource (difficult to trigger) + * fixed a NULL-ptr deref (a OOPS) caused by a rare race condition + while taking a resource down + * fix a possible hard kernel-lockup, can only be triggerd when a + CPU-mask is configured + * updated kernel compatibility to at least Linux head and also fixed + a bug in the compat checks/rules that caused OOPSes of the previous + drbd releases when compiled with Linux-6.2 (or on RHEL 9.2 kernel). + * fix an aspect of the data-generation (UUID) handling where DRBD + failed to do a resync when a diskless node in the remaining + partition promotes and demotes while a diskful node is isolated + * fix an aspect of the data-generation (UUID) handling where DRBD + considered a node to have unrelated data; this bug was triggered by + a sequence involving removing two nodes from a cluster and readding + one with the "day-0" UUIDs. + * do not block specific state changes (promote, demote, attach, and + detach) when only some nodes add a new minor + + * 9.1.14 (api:genl2/proto:86-121/transport:18) + * fix a race with concurrent promotion and demotion, which can + lead to an unexpected "split-brain" later on + * fix a specific case where promotion was allowed where it should not + * fix a race condition between auto-promote and a second two-phase + commit that can lead to a DRBD thread locking up in an endless loop + * fix several bugs with "resync-after": + - missing resync-resume when minor numbers run in opposite + direction as the resync-after dependencies + - a race that might lead to an OOPS in add_timer() + * fix an OOPS when reading from in_flight_summary in debugfs + * fix a race that might lead to an endless loop of printing + "postponing start_resync" while starting a resync + * fix diskless node with a diskfull with a 4KiB backend + * simplify remembering two-pc parents, maybe fixing a one-time-seen bug + * derive abort_local_transaction timeout from ping-timeout + + * 9.1.13 (api:genl2/proto:86-121/transport:18) + * when calculating if a partition has quorum, take into account if + the missing nodes might have quorum + * fix forget-peer for diskless peers + * clear the resync_again counter upon disconnect + * also call the unfence handler when no resync happens + * do not set bitmap bits when attaching to an up-to-date disk (late) + * work on bringing the out-of-tree DRBD9 closer to DRBD in the upstream + kernel; Use lru_cahche.ko from the installed kernel whenever possible + + * 9.1.12 (api:genl2/proto:86-121/transport:18) + * fix a race that could result in connection attempts getting aborted + with the message "sock_recvmsg returned -11" + * rate limit messages in case the peer can not write the backing storage + and it does not finish the necessary state transitions + * reduced the receive timeout during connecting to the intended 5 seconds + (ten times ping-ack timeout) + * losing the connection at a specific point in time during establishing + a connection could cause a transition to StandAlone; fixed that, so + that it keeps trying to connect + * fix a race that could lead to a fence-peer handler being called + unexpectedly when the fencing policy is changed at the moment before + promoting + + * 9.1.11 (api:genl2/proto:86-121/transport:18) + * The change introduced with 9.1.10 created another problem that might + lead to premature request completion (kernel crash); reverted that + change and fix it in another way + + * 9.1.10 (api:genl2/proto:86-121/transport:18) + * fix a regression introduced with 9.1.9; using protocol A on SMP + with heavy IO can might cause kernel crash + + * 9.1.9 (api:genl2/proto:86-121/transport:18) + * fix a mistake in the compat generation code; it broke DRBD on + partitions on kernel older than linux 5.10 (this was introduced + with drbd-9.1.8; not affected: logical volumes) + * fix for a bug (introduced with drbd-9.0.0), that caused possible + inconsistencies in the mirror when using the 'resync-after' option + * fix a bug that could cause a request to get stuck after an unlucky + timing with a loss of connection + * close a very small timing window between connect and promote that + could lead to the new-current-uuid not being transmitted to the + concurrently connecting peer, which might lead to denied connections + later on + * fix a recently introduced OOPS when adding new volumes to a + connected resource + * fix online attach when the connection to a 3rd node is down + + * 9.1.8 (api:genl2/proto:86-121/transport:18) + * restore protocol compatibility with drbd-8.4 + * detect peers that died silently when starting a two-phase-commit + * correctly abort two-phase-commits when a connection breaks between + phases 1 and 2 + * allow re-connect to a node that was forced into secondary role and + where an opener is still present from the last time it was primary + * fix a race condition that allowed to configure two peers with the + same node id + * ensure that an open() call fails within the auto-promote timeout + if it can not succeed + * build fixes for RHEL9 + * following upstream changes to DRBD up to Linux 5.17 and updated compat + + * 9.1.7 (api:genl2/proto:110-121/transport:18) + * avoid deadlock upon trying to down an io-frozen DRBD device that + has a file system mounted + * fix DRBD to not send too large resync requests at multiples of 8TiB + * fix for a "forgotten" resync after IO was suspended due to lack of quorum + * refactored IO suspend/resume fixing several bugs; the worst one could + lead to premature request completion + * disable discards on diskless if diskful peers do not support it + * make demote to secondary a two-phase state transition; that guarantees that + after demotion, DRBD will not write to any meta-data in the cluster + * enable "--force primary" in for no-quorum situations + * allow graceful recovery of primary lacking quorum and therefore + have forzen IO requests; that includes "--force secondary" + * following upstream changes to DRBD up to Linux 5.15 and updated compat + + * 9.1.6 (api:genl2/proto:110-121/transport:17) + * fix IO to internal meta-data for backing device larger than 128TB + * fix resending requests towards diskless peers, this is relevant when + fencing is enabled, but the connection is re-established before fencing + succeeds; when the bug triggered it lead to "stuck" requests + * remove lockless buffer pages handling; it still contained very hard to + trigger bugs + * make sure DRBD's resync does not cause unnecessary allocation in + a thinly provisioned backing device on a resync target node + * avoid unnecessary resync (or split-brain) due to a wrongly generated + new current UUID when an already IO frozen DBRD gets new writes + * small fix to autopromote, when an application tries a read-only open + before it does a read-write open immediately after the peer primary + vanished ungracefully + * split out the secure boot key into a package on its own, that is + necessary to allow installation of multiple drbd kernel module packages + * Support for building containers for flacar linux + + * 9.1.5 (api:genl2/proto:110-121/transport:17) + * merged all changes from drbd-9.0.32 + - fix a read-access-after-free, that could cause an OOPs; triggers with + an unusual configuration with a secondary having a smaller AL than + the primary or a diskless primary and heavy IO + - avoid a livelock that can cause long IO delays during resync on a + primary resync-target node + - following upstream changes to DRBD up to Linux 5.14 and updated compat + (including RHEL9-beta) + - fix module override for Oracle-Linux + * fixed a locking regression of the 9.1 branch, only relevant in + the moment a local backing device delivers an IO error to drbd + * removed compat support for kernel older than Linux-3.10 (RHEL7) + * code cleanups and refactoring + + * 9.1.4 (api:genl2/proto:110-121/transport:17) + * merged all changes from drbd-9.0.31 + * enabled dynamic debug on some additional log messages + * remove (broken) write conflict resolution, replace it with warning + about the fact + * debugfs entry for the interval tree + + * 9.1.3 (api:genl2/proto:110-120/transport:17) + * merged all fixes from drbd-9.0.30-0rc1 + * fix a corner-case NULL deref in the lockless buffer pages handling; the + regression was introduced with 9.1.0 (released Feb 2021); To my knowledge + it took 6 months until someone triggered it for the first time + * fix sending a P_PEERS_IN_SYNC packet into a fresh connection (before + handshake packets); this problem was introduced when the drbd-8.x + compatibility code was removed + * remove sending a DRBD-barrier packet when processing a REQ_PREFLUSH + request, that improves IO-depth and improves performance with that + + * 9.1.2 (api:genl2/proto:110-120/transport:17) + * merged all fixes from drbd-9.0.29; other than that no changes in this branch + + * 9.1.1 (api:genl2/proto:110-119/transport:17) + * 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 + * 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 + * fix a merge-mistake that broke compatibility with 5.10 kernels + + * 9.1.0 (api:genl2/proto:110-119/transport:16) + * was forked off from drbd 9.0.19 + * has all changes up to 9.0.28-1 + * locking in the IO-submit code path was considerably improved, + allowing multiple CPU to submit in parallel + + * rename patch + - fix-resync-finished-with-syncs-have-bits-set.patch + + bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch + + * remove patches which are already included in upstream code: + - bsc-1192929_01-make_block_holder_optional.patch + - bsc-1192929_02-move_kvmalloc_related_to_slab.patch + - bsc-1192929_03-polling_to_bio_base.patch + - bsc-1192929_04-pass_gend_to_blk_queue_update_readahead.patch + - bsc-1192929_07-add_disk_error_handle.patch + - bsc-1192929_08-have_void_drbd_submit_bio.patch + - bsc-1192929_09-remove_bdgrab.patch + - bsc-1201335_01-compat-test-and-cocci-patch-for-bdi-in-gendisk.patch + - bsc-1201335_02-compat-only-apply-bdi-pointer-patch-if-bdi-is-in-req.patch + - bsc-1201335_03-genhd.patch + - bsc-1201335_04-bio_alloc_bioset.patch + - bsc-1201335_05-bio_alloc.patch + - bsc-1201335_06-bdi.patch + - bsc-1201335_07-write-same.patch + - bsc-1201335_08-bio_clone_fast.patch + - bsc-1202600_01-remove-QUEUE_FLAG_DISCARD.patch + - bsc-1202600_02-dax-introduce-DAX_RECOVERY_WRITE-dax-access-mode.patch + - bsc-1202600_03-block-decouple-REQ_OP_SECURE_ERASE-from-REQ_OP_DISCA.patch + - bsc-1202600_04-remove-assign_p_sizes_qlim.patch + - bsc-1204596_01-block-remove-blk_cleanup_disk.patch + - bsc-1204596_02-drbd-remove-usage-of-bdevname.patch + - bsc-1206791-01-drbd-add-comments-explaining-removal-of-bdi-congesti.patch + - bsc-1206791-02-drbd-fix-static-analysis-warnings.patch + - bsc-1206791-03-drbd-fix-warning-about-initializing-multiple-struct-.patch + - bsc-1206791-04-blk_queue_split__no_present.patch + - bsc-1206791-05-prandom_u32_max.patch + - bsc-1206791-06-write_zeroes__no_capable.patch + - bsc-1206791-07-drbd-fix-use-after-free-bugs-in-get_initial_state.patch + - bsc-1206791-08-lib-lru_cache-Fixed-array-overflow-caused-by-incorre.patch + - bsc-1206791-09-pmem-use-fs_dax_get_by_bdev-instead-of-dax_get_by_ho.patch + +------------------------------------------------------------------ +Sat Mar 11 06:25:00 UTC 2023 - Heming Zhao + +- drbd: fix build error against kernel v6.2.1 (bsc#1209168) + * update patch + + bsc-1206791-05-prandom_u32_max.patch + +------------------------------------------------------------------- +Thu Jan 6 01:40:00 UTC 2023 - Heming Zhao + +- remove useless patch, dax_get_by_host() was replaced by fs_dax_get_by_bdev() + * bsc-1192929_06-dax_support.patch + +------------------------------------------------------------------- +Thu Jan 5 11:13:00 UTC 2023 - Heming Zhao + +- drbd: fix build error against kernel v6.1.1 (bsc#1206791) + * update bsc-1201335_06-bdi.patch commit log (no code change) + + bsc-1201335_06-bdi.patch + * update bsc-1202600_02-dax-introduce-DAX_RECOVERY_WRITE-dax-access-mode.patch (no code change) + + bsc-1202600_02-dax-introduce-DAX_RECOVERY_WRITE-dax-access-mode.patch + * using upstream patch to replace exist patch + - bsc-1204596_02-drbd-stop-using-bdevname-in-drbd_report_io_error.patch + + bsc-1204596_02-drbd-remove-usage-of-bdevname.patch + * add new patches + + bsc-1206791-01-drbd-add-comments-explaining-removal-of-bdi-congesti.patch + + bsc-1206791-02-drbd-fix-static-analysis-warnings.patch + + bsc-1206791-03-drbd-fix-warning-about-initializing-multiple-struct-.patch + + bsc-1206791-04-blk_queue_split__no_present.patch + + bsc-1206791-05-prandom_u32_max.patch + + bsc-1206791-06-write_zeroes__no_capable.patch + + bsc-1206791-07-drbd-fix-use-after-free-bugs-in-get_initial_state.patch + + bsc-1206791-08-lib-lru_cache-Fixed-array-overflow-caused-by-incorre.patch + + bsc-1206791-09-pmem-use-fs_dax_get_by_bdev-instead-of-dax_get_by_ho.patch + +------------------------------------------------------------------- +Mon Dec 5 12:47:43 UTC 2022 - Ludwig Nussel + +- BuildRequire %kernel_module_package_buildreqs (boo#1205149) + +------------------------------------------------------------------- +Sat Oct 22 12:23:00 UTC 2022 - Heming Zhao + +- drbd: build error against kernel v6.0.2 (bsc#1204596) + - add patch: + + bsc-1204596_01-block-remove-blk_cleanup_disk.patch + + bsc-1204596_02-drbd-stop-using-bdevname-in-drbd_report_io_error.patch + +------------------------------------------------------------------- +Tue Aug 23 00:13:00 UTC 2022 - Heming Zhao + +- drbd: build error against kernel v5.19 (bsc#1202600) + - add patch: + + bsc-1202600_01-remove-QUEUE_FLAG_DISCARD.patch + + bsc-1202600_02-dax-introduce-DAX_RECOVERY_WRITE-dax-access-mode.patch + + bsc-1202600_03-block-decouple-REQ_OP_SECURE_ERASE-from-REQ_OP_DISCA.patch + + bsc-1202600_04-remove-assign_p_sizes_qlim.patch + - For rpmbuild warning, modify symlink /usr/sbin/rcdrbd to relative path + + drbd.spec + +------------------------------------------------------------------- +Fri Jul 08 12:47:00 UTC 2022 - Heming Zhao + +- drbd: build error against kernel v5.18 (bsc#1201335) + - remove patch: + + move_bdi_from_request_queue_to_gendisk.patch + - change exist patches name from bsc#1192929: + old name: + make_block_holder_optional.patch + move_kvmalloc_related_to_slab.patch + polling_to_bio_base.patch + pass_gend_to_blk_queue_update_readahead.patch + dax_support.patch + add_disk_error_handle.patch + have_void_drbd_submit_bio.patch + remove_bdgrab.patch + new name: + bsc-1192929_01-make_block_holder_optional.patch + bsc-1192929_02-move_kvmalloc_related_to_slab.patch + bsc-1192929_03-polling_to_bio_base.patch + bsc-1192929_04-pass_gend_to_blk_queue_update_readahead.patch + bsc-1192929_06-dax_support.patch + bsc-1192929_07-add_disk_error_handle.patch + bsc-1192929_08-have_void_drbd_submit_bio.patch + bsc-1192929_09-remove_bdgrab.patch + - add patch: + + bsc-1201335_01-compat-test-and-cocci-patch-for-bdi-in-gendisk.patch + + bsc-1201335_02-compat-only-apply-bdi-pointer-patch-if-bdi-is-in-req.patch + + bsc-1201335_03-genhd.patch + + bsc-1201335_04-bio_alloc_bioset.patch + + bsc-1201335_05-bio_alloc.patch + + bsc-1201335_06-bdi.patch + + bsc-1201335_07-write-same.patch + + bsc-1201335_08-bio_clone_fast.patch + +------------------------------------------------------------------- +Mon Nov 22 04:38:30 UTC 2021 - nick wang + +- bsc#1192929, compat to kernel v5.15 +- Remove patch convert_to_blk_alloc_disk.patch (upstream) +- Add patch make_block_holder_optional.patch + Add patch move_kvmalloc_related_to_slab.patch + Add patch polling_to_bio_base.patch + Add patch pass_gend_to_blk_queue_update_readahead.patch + Add patch move_bdi_from_request_queue_to_gendisk.patch + Add patch dax_support.patch + Add patch add_disk_error_handle.patch + Add patch have_void_drbd_submit_bio.patch + Add patch remove_bdgrab.patch + +------------------------------------------------------------------- +Wed Jul 21 06:23:09 UTC 2021 - nick wang + +- Update to 9.0.30~1 + * fix a crash when drbd-9 node gets connected to a drbd-8.4 node, the + regression was introduced between 9.0.25 and 9.0.26 + * A improved approach to serialize rsyncs from multiple sources; the previous + one could cause wrong accounting for online verify + * fix a race condition that could cause resync operations to stall when the + completion of one resync allows another one to proceed + * fix a race condition that could cause an online verify operation to not + terminate under specific conditions (corking enabled no other IO) + * fix locking of drbd_devices idr that caused (very rarely) create/remove + minor to fail +- Add patch convert_to_blk_alloc_disk.patch (kernel b647ad024) +- Remove patch compat_genl_maxattr_in_ops.patch +- Delete _servicedata file since not used + +------------------------------------------------------------------- +Fri Jun 11 15:28:19 UTC 2021 - nick wang + +- Correct the real version 9.0.29~1 +- Disable _servicedata to avoid verbose commits log + +------------------------------------------------------------------- +Fri Jun 04 13:27:15 UTC 2021 - varkoly@suse.com + +- Update to version 9.1.2 + * drbd: fix termination of verify with stop sector + * drbd: Fix locking for the drbd_devices idr + * drbd: use DEFINE_MUTEX insteadm of mutex_init() + * drbd: remove device_to_minor() + * drbd: fix race condition resetting resync_next_bit + * build: fix make; make clean; make; with pre-packaged compat.patch + * compat: fix compat implementation of CRYPTO_TFM_NEED_KEY + * drbd: remove non-existant argument from kerneldoc + * drbd: kernel-doc and related fixes from upstream + * drbd: Avoid comma separated statements + +------------------------------------------------------------------- +Fri May 7 05:53:20 UTC 2021 - nick wang + +- 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 + +- bsc#1183429, compat to kernel v5.11 + Add patch compat_to_v5_11.patch + +------------------------------------------------------------------- +Wed Dec 9 06:40:33 UTC 2020 - nick wang + +- 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 + +- 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 + +- bsc#1178388, build error with -Wreturn-type + Add patch fix-err-of-wrong-return-type.patch + +------------------------------------------------------------------- +Tue Oct 20 03:49:16 UTC 2020 - nick wang + +- bsc#1177910, compat to kernel v5.9 + Add patch blk_alloc_queue_make_request.patch + Add patch compat_generic_make_request.patch + Add patch remove_congested_fn_congested_data.patch +- Add tumbleweed only patch + Add patch compat_blk_queue_stack_limits.patch + +------------------------------------------------------------------- +Fri Sep 18 07:38:21 UTC 2020 - nick wang + +- bsc#1175257, update to 9.0.25-0rc1 + * fix a race condition between receiving UUIDs and finishing a resync + that can lead to a false-positive split-brain detection later on + * fix access after free of peer_req objects, that only happened when + a resync target node is paused sync source at the same time + * fix abortion of local state changes in case they can not proceed due + to loss of connection + * fix corner cases with reconciliation resync and parallel promote + * fix an issue establishing a connection when the multipath feature is + used to connect to a stacked resource without a dedicated service IP + * fix sometimes a peer-disk state to another resync-target staying Outdated + after two resyncs from the same sync source node finish + * fix an (unlikely) deadlock while establishing a connection + * deactivate the kref_debug code, it has performance implicatios + * Introduce the "disconnected" hander; it receives the last connection + state in the evnironment variable DRBD_CSTATE +- Changes of drbd-9.0.24-1 + * fix deadlock when connecting drbd-9 to drbd-8.4 and the drbd-9 + side becomes sync-source + * fix an issue with 3 (or more) node configurations; with a diskless node + and two storage nodes; if one of the storage nodes was hard rebooted + and came back and the diskless got primary and did not issue write + requests and the returning storage node established a connection with + the surviving storage node first, DRBD failed to upgrade the disk + state to UpToDate after the resync + * detect split-brain situations also when both nodes are primary; + this is how it was in drbd-8.4; up to now drbd-9 did not realize + the split-brain since it complains about the not allowed dual + primary first; for this change a new protocol version was necessary + * verified it compiles with Linux 5.7 +- Add compatible patches to kernel v5.8.0 + Add patch compat_remove_include_vermagic.patch + Add patch compat_remove_kernel_setsockopt.patch + Add patch compat_remove_pgprot_88dca4c.patch + +------------------------------------------------------------------- +Wed Jun 10 03:33:22 UTC 2020 - nick wang + +- bsc#1172761, Update to drbd-9.0.23-1 + * fix a deadlock (regression introduced in 9.0.22) that can happen when + new current UUID is generated while a connection gets established + * Do not create a new data generation if the node has + 'allow-remote-read = no' set, is primary, and the local disk fails + (because it has no access to good data anyome) + * fix a deadlock (regression introduced in 9.0.22) that can be + triggered if a minor is added into a resource with an established + connection + * generate new UUID immediately if a primary loses a disk due to an IO + error + * fix read requests on diskless nodes that hit a read error on a + diskful node; the retry on another diskful node works, but a bug + could lead to a log-storm on the diskless node + * fix removal of diskless nodes from clusters with quorum enabled + (initiated from the diskless itself) + * fix wrongly declined state changes if connections are established + concurrently + * fix continuation of initial resync; before that the initial resync + always started from the beginning if it was interrupted + * use rwsem _non_owner() operations to avoid false positives of + lock-dep when running on a debug kernel + * fix a sometimes missed resync if only a diskless node was primary + since the day0 UUID + * fix a corner case where a SyncSource node does not recognise + that a SyncTarget node declared the resync as finished + * update compat up to Linux 5.6 +- Remove patch without_pr_warning.patch since change in 7e6a20f7 + +------------------------------------------------------------------- +Wed Jun 10 02:55:39 UTC 2020 - nick wang + +- jsc#11801, enable buildrt for Leap15.2 but Tumbleweed. + +------------------------------------------------------------------- +Tue Mar 10 09:03:04 UTC 2020 - nick wang + +- bsc#1166298, Update to drbd-9.0.22-1 + * introduce locking to avoid connection retries when UUIDs or + relevant flags change during the exchange of this data + * improve serialization of events after loosing a primary + * fix a constraint in sanitize state that can caused a promote to be + deliced by some other node + * fix a case of a false positive detection of a split brain condition + * allow a resync target to switch to the resync source with less + bits out of sync + * fix bitmap UUID after resync to use current UUID from self rather + than sync source + * fix pushing bitmap UUID into history when changed + * fix regression introduced with 9.0.20, that can cause a missed + resync after a reconciliation resync + * fix regression introduced with 9.0.20, that can cause a missed + resync after a promote on a diskless node + * fix UUID handling in case a node promotes during (a short) + reconciliation resync + * fix removing of a diskless node when quorum is enabled + +------------------------------------------------------------------- +Tue Feb 25 07:03:39 UTC 2020 - nick wang + +- Update to drbd-9.0.21-1, require coccinelle >= 1.0.8 + * fix compat for write same on linux 4.9 and the Debian users + * fix kernel compat for linux 4.8 and 4.9; this mainly affected Debian + users; The symptoms where slow resync and resync getting stuck always at + the same point + * enable resync of lost and re-created backing devices (think lost node) when + the backing device was thinly provisioned and its current uuid is pre-set + to a 'day0 UUID' (by LINSTOR); that works by copying a unused bitmap slot + which tracks all changes since day 0 + * fix attach when bitmap is on PMEM; before it was set to + 'all blocks out-of-sync' upon attach + * avoid doing reconciliation resync multiple times by updating the + resync target's dagtag after if completed successfully + * return disk-state from Outdated to UpToDate when it loses connection + while in WFBitMapT and we have a stable and UpToDate peer + * new option --force-resync flag can be passed to new-current-uuid, that + can be used to trigger initial resync without touching the role +- Remove upstream drbd-update-resync-target-s-dagtag.patch +- Modify patch suse-coccinelle.patch to adopt spaas + +------------------------------------------------------------------- +Fri Jan 3 08:52:14 UTC 2020 - nick wang + +- bsc#1159786, fix build issue against v5.5 + add patch without_pr_warning.patch + +------------------------------------------------------------------- +Thu Dec 26 07:55:03 UTC 2019 - nick wang + +- bsc#1159333, back port patch for duplicate resync. + add patch drbd-update-resync-target-s-dagtag.patch + +------------------------------------------------------------------- +Mon Dec 16 06:29:42 UTC 2019 - nick wang + +- bsc#1158446, fix metadata limit due to 64k page size of ppc64le. + add patch drbd-fix-zero-metadata-limit-by-page-size-misaligned.patch + +------------------------------------------------------------------- +Thu Oct 17 17:48:47 UTC 2019 - Richard Brown + +- Remove obsolete Groups tag (fate#326485) + +------------------------------------------------------------------- +Fri Oct 11 02:32:09 UTC 2019 - nick wang + +- Update to drbd-9.0.20-1 + * fix a case of false split brain detection if a diskless node promotes + multiple times, by aligning the rules for generating a new current-UUID + on a diskless nodes with them on a node with disk + * check if we still have quorum by exchanging a drbd-ping with peers + before creating new current UUID after loosing one peer + * fix after weak handling to not interfere with reconciliation resyncs + * retry connect when one of the relevant flags changes during UUID exchange + * fix reconciliation resync if one of the secondary got an current-UUID update + * fix resync to make progress after it was paused by an other resync operation + * fix false split-brains when a resync source changes current-UUID during + resync operation + * fix restore of D_OUTDATED when the resource first only attached and + then the peer objects are created (in contrast to the usual, new-peer, + attach, connect) + * abort creating new current-UUID when writing to meta-data fails in + the moment where the new-current-UUID should be written + * removed DRBD marking itself as read-only when secondary; this flag + was exposed using the BLKROGET ioctl; that should be left to user-land + use; recent KVM checks that flag, and does not dare auto-promote when + set by DRBD + * fix a small memory-leak when creating peer devices + * fix a possible information leak of kernel memory that pads net-link packets + * completing implications of "allow-remote-read=no"; i.e. when not to + create a new-current-UUID as read-write access to the data set was lost; + also fail both reads and writes if reads are no longer possible + * new option value "rr-conflict=retry-connect"; that helps in scenarios with + quorum where stopping a service takes longer than a temporarily network + outage and DRBD's reconnect + * code cleanups, introduced enums for remaining magic numbers + * new kernel-backward-compatibility framework based on spatch/coccinelle, + replacing an unmaintainable moloch of C preprocessor hell; Merged the + complete kernel-compat submodule + * ships with pre-computed compat-patches for main distros' kernels; in case + an other kernel is found it tries to use local spatch, if that is not + installed the build process tries to use a LINBIT hosted web service + to create the compat patch ("spatch-as-a-service"). + * compat with up to Linux-5.3-rc2 +- Modify patch suse-coccinelle.patch to adopt spaas + +------------------------------------------------------------------- +Wed Sep 20 08:22:12 UTC 2019 - nick wang + +- bsc#1151579, fix collinelle default path and always trigger in obs + Add patch suse-coccinelle.patch + +------------------------------------------------------------------- +Tue Sep 17 04:31:08 UTC 2019 - nwang@suse.com + +- bsc#1146117, disallow dual primaries when not configured. + Modify patch rely-on-sb-handles.patch + +------------------------------------------------------------------- +Tue Sep 10 07:45:05 UTC 2019 - Jan Engelhardt + +- Restore higher summary specifity. +- Drop old-age %clean, %defattr. + +------------------------------------------------------------------- +Mon Sep 9 07:09:37 UTC 2019 - nick wang + +- bsc#1149945, update to 8e93a5d93 (drbd-9.0 branch) + * Coccinelle support + * compat with up to Linux-5.3 +- Remove patch compat_no_bioset_initialized.patch + +------------------------------------------------------------------- +Fri Jul 19 03:06:11 UTC 2019 - nwang@suse.com + +- Update to 9.0.19-1 + * check on CAP_SYS_ADMIN instead of CAP_NET_ADMIN for certain operations + * fix detection of unstable resync + * fix possible stuck resync when resync started from an other secondary + and later continued from a primary + * fix NULL dereference with disk-timeout enabled; was introduced in 9.0.9 + * retry connect when own current UUID changes during UUID exchange + * fix quorum tie-breaker diskless logic for settings other than "majority" + * disable quorum tie-breaker for 0 voters + * fix dax_direct_access() error return check + * fix resync stuck at near completion; bug was intorduces with 9.0.17 + * unblock IO when on-quorum-lost policy is changed (suspend -> io-error) + * introduce allow-remote-read configuration option; set it to "no" for + DR links you only want to write, but never read + * only complain about UUID changes during initial handshake + +------------------------------------------------------------------- +Tue May 28 05:52:07 UTC 2019 - nwang@suse.com + +- Upgrade to 9.0.18-1 + * Fix an IO deadlock under memory pressure + * Fix disconnect timing in case the network connection suddenly + drops all packets + * Fix some misbehavior that surfaced with Ahead/Behind + * Fix potential spinlock deadlock in IRQ + * Minor fixes: forget-peer, _rcu iterators + * Quickly stop resync during AHEAD/BEHIND by introducing new + packet for that purpose. + * The quorum feature can now use the connectivity to + the majority of Diskless nodes as tiebreaker + * Access meta-data using DAX if it is on persistent memory + (NVDIMM or PMEM); For write intense workloads this is a x2 to x4 speedup! +- Remove patch fix-make-error.patch since merged into upstream(46e8e3fc) + +------------------------------------------------------------------- +Fri Mar 22 02:10:17 UTC 2019 - nwang@suse.com + +- Upgrade to 9.0.17-1 + * Fix UUID handling of a diskless primary that has not peer with + usable data may not touch the current UUID + * Fix resync-after dependencies; cross-resource dependencies + and missing resources + * Fix resync when the sync source suddenly connects to a more recent + data set via an other connection and becomes sync target on that + other connection; pause first resync; fix wrong display of negative + resync progress percentage in this case + * Fix volume numbers between 32767 and 65534 + * Fix the data integrity implementation; it was broken since drbd-9.0 + and reported only false positives + * Fix for a corner-case when a promote action happens concurrently with + a reconciliation resync + * Improve resync code to be able to fully utilize fast storage + backend devices and fast networks with resync traffic; as a side + effect the settling time of the resync controller got shorter in + for most cases + * Show in the user-visible message who the opener is if if demote/down + fails doe to someone holding a drbd device open + * docker file for a "load drbd module container" and allow to disable + user-mode-helpers, which is necessary for this container +- Add patch fix-make-error.patch for build error of make against TW. + +------------------------------------------------------------------- +Thu Jan 10 02:16:03 UTC 2019 - nwang@suse.com + +- bsc#1118732, split brain handles malfunction when 2 primaries. +- Add patch rely-on-sb-handlers.patch + +------------------------------------------------------------------- +Mon Dec 10 08:06:53 UTC 2018 - nwang@suse.com + +- bsc#1118841, kernel compatible issue. + Have bioset_init but no bioset_initialized +- Add patch compat_no_bioset_initialized.patch + Remove patch compat_have_mempool_init.patch + +------------------------------------------------------------------- +Wed Nov 21 07:47:51 UTC 2018 - nwang@suse.com + +- bsc#1116820, kernel compatible issue of sle15sp1 +- Add patch compat_have_mempool_init.patch + +------------------------------------------------------------------- +Fri Oct 26 03:01:05 UTC 2018 - nwang@suse.com + +- bsc#1115606, Update to 9.0.16-1 +* Fix regression (introduced with 9.0.15) in handling request timeouts +* Fix a possible distributed loop when establishing a connection +* Fix a corner case in case a resync "overtakes" an other one +* Fix clearing of the PRIMARY_LOST_QUORUM flag +* Check peers before generating new current UUID after loosing a node +* In case the locally configured address of a connection is not + available keep on retrying until it comes back + + +------------------------------------------------------------------- +Mon Jul 23 02:32:47 UTC 2018 - nwang@suse.com + +- Update to 9.0.15-1 +* fix tracking of changes (on a secondary) against the lost disk of a + primary and also fix re-attaching in case the disk is replaced +* fix live migrate of VMs on DRBD when migrated to/from diskless nodes +* fix an IO deadlock in DRBD when the activity log on a secondary runs + full +* fix hanging demote after IO error followed by attaching the disk + again and the corresponding resync +* fix DRBD dopping connection after an IO error on the secondary node +* improve details when online changing devices from diskless to with + disk and vice versa. (Including peers freeing bitmap slots) +* new module parameter to disable support for older protocol versions +* improve details when online changing devices from diskless to with disk +* remove no longer relevant compat tests +* expose openers via debugfs +* optimize IO submit code path +* compat for v4.18 kernel + +------------------------------------------------------------------- +Thu May 3 01:04:29 UTC 2018 - nwang@suse.com + +- Update to 9.0.14-1 +* fix regression in 9.0.13: call after-split-brain-recovery + handlers no auto-recovery strategies (not even the default: + disconnect) would be applied, nodes would stay connected + and all nodes would try to become the source of the resync. +* fix spurious temporary promotion failure: if after Primary + loss failover happened too quickly, transparently retry internally. +* fixup recently introduced P_ZEROES to actually work as intended +* fix online-verify to account for skipped blocks; otherwise, + it won't notice that it has finished, apparently being stuck + near "100% done" +* expose more resync and online-verify statistics and details +* improve accounting of "in-flight" data and resync requests +* allow taking down an already useless minor device during "down", + even if it is (temporarily) opened by for example udev scanning +* fix for a node staying "only" Consistent and not returning + to UpToDate in certain scenarios when fencing is enabled +* fix data generation UUID propagate during resync +* compat for upstream kernels up to v4.17 + + +------------------------------------------------------------------- +Sun Apr 8 02:00:53 UTC 2018 - nwang@suse.com + +- bsc#1090167, Update to 9.0.13-1 +* abort a resync if a resync source becomes weakly and the sync + targetis a neighbor of the primary +* fix UUID handling with multiple diskless nodes +* When a data-set gets into contact with an all diskless cluster, + make sure to either set it to "Consistent" or reject the attach +* correctly handle when a node that was marked as intentional + diskless should get a disk +* fix outdating of weakly connected nodes +* made returning from Ahead to SyncSource more reliable +* fix a hard to trigger deadlock in the receiver +* fix online resize in the presence of two or more diskless nodes +* fix online add of volumes to diskless nodes when it already has + established connections +* Set the SO_KEEPALIVE socket option on data sockets +* automatically solve a specific split brain when quorum is enabled +* Compat: Added support for kernels up to v4.15.x +* new wire packet P_ZEROES a cousin of P_DISCARD, following the + kernel as it introduced separated BIO ops for writing zeros + and discarding +* compat workaround for two RHEL 7.5 idiosyncrasies regarding + refcount_t and struct nla_policy +- Remove patch support-timer-setup.patch. Upstream fix 74b1cbb274 + +------------------------------------------------------------------- +Sun Feb 11 06:39:19 UTC 2018 - nwang@suse.com + +- bsc#1080458, enable build with kernel-rt on x86_64. +- bsc#1080459, support build against 4.15.0. + setup_timer() change to timer_setup() +- Add patch support-timer-setup.patch + +------------------------------------------------------------------- +Wed Jan 24 03:44:56 UTC 2018 - nwang@suse.com + +- bsc#1077318, Update to 9.0.12 +* Fix a race condition in the device_open code path that can cause an + internal counter to go negative +- Update to 9.0.11 +* Fix bug in compat code: Without this fix large bios are not split. + +------------------------------------------------------------------- +Wed Dec 6 07:24:09 UTC 2017 - nwang@suse.com + +- bsc#1074169, Update to 9.0.10-1 +* Fix resync of two secondary nodes in the presence of + a 3rd node that is primary (maybe with disk or diskless); + Fixed the race condition that caused the resync to sometimes not terminate +* Improve connection behavior with autopromote enable one node Primary and + udev present. +* Fix in memory alignment of DRBD's struct bio. +* Improve the quorum implementation, so that is works nicely with for the + purpose of replacing fencing with quorum in a Pacemaker setup. +* Ensure compatibility with upstream Linux kernel 4.14 +- Remove patch reproducible.patch + +------------------------------------------------------------------- +Fri Nov 17 03:03:20 UTC 2017 - nwang@suse.com + +- bsc#1068587, add build request libelf-devel to build. + +------------------------------------------------------------------- +Wed Oct 11 09:58:26 UTC 2017 - nwang@suse.com + +- bsc#1062749, disable buildrt against SLE15 x86_64 temporarily. + This change will be removed when rt is ready. + +------------------------------------------------------------------- +Fri Oct 6 07:48:08 UTC 2017 - nwang@suse.com + +- bsc#1061981, update to 9.0.9 + * fix occasionally forgotten resyncs in installations where + diskless primaries are present. + * fix an issue that causes unexpected split-brain upon connect. + * in a cluster with a diskless primary, when a server goes away, + and is not outdated, outdate it upon reconnect. + * fix update of exposed data UUID on diskless primaries. + * fix a possible OOPS when in a debug message regarding bitmap + locking + * fix discard bigger than 1MiB + * fix left over bits in bitmap on SyncSource after resync + * fix peers becoming unexpectedly displayed as D_OUTDATED at the + end of a resync + * fix a race between auto promote and auto demote of multiple volumes + in a single resource + * Speed up down of many resources by using call_rcu() instead + of synchronize_rcu() + * Make it compatible with the soon to be released 4.13 kernel +- Modify reproducible.patch since part of the patch is merged + +------------------------------------------------------------------- +Wed Jul 19 05:01:10 UTC 2017 - bwiedemann@suse.com + +- Add reproducible.patch to sort file lists (boo#1041090) + and to override build date (boo#1047218) to fix build-compare + +------------------------------------------------------------------- +Wed Jun 14 03:21:59 UTC 2017 - nwang@suse.com + +- bsc#1045473, update to 9.0.8 + fix a race condition between adding connections and receiving data + fix a OOPS on a diskfull node when a request from a diskless node + fix a distributed deadlock when doing a discard/write-same burst + fix an issue with diskless nodes adopting wrong current UUIDs + fix wrongly rejected two-phase-state transactions + fix initial resync, triggered by "--force primary"(regression 9.0.7) + Speed-up AL-updates with bio flags REQ_META and REQ_PRIO + Merged changes from 8.4.10 and with that compatibility with Linux-4.12 +- Remove patch fix-initial-sync-stop.patch +- Fix the license to GPL-2.0+ + +------------------------------------------------------------------- +Thu May 25 07:55:55 UTC 2017 - nwang@suse.com + +- bsc#1038852, fix initial sync not triggered + add patch fix-initial-sync-stop.patch + +------------------------------------------------------------------- +Wed Apr 26 09:03:00 UTC 2017 - nwang@suse.com + +- Update to 9.0.7 + Using 9.0.7rc2 for upgrading from rc1... +- bsc#1028124, fix kernel compat +- Fix a potenial split brain +- Change the drbd-utils requirement to 8.9.11 + +------------------------------------------------------------------- +Fri Mar 24 07:44:01 UTC 2017 - nwang@suse.com + +- Update to 9.0.7rc1 +- various fixes to the 2-phase-commit online resize + fix fencing and disk state trasition and from consistent, necessary + for crm-fence-peer + fix calculation of authoritative nodes + Quorum to avoid data divergence, an alternative to fencing + Compat with Linux 4.10 +- Remove patch drbd_wrapper-Blank-out-WRITE_SYNC-warning-for-new-ke.patch +- Add fix-resync-finished-with-syncs-have-bits-set.patch for bsc#1025089 +- Including the compatible fix of bsc#1031299 + +------------------------------------------------------------------- +Mon Mar 6 16:14:45 CET 2017 - hare@suse.de + +- Compability fixes for SLE12 SP3 (bsc#993388, FATE#321732) +- Add patch drbd_wrapper-Blank-out-WRITE_SYNC-warning-for-new-ke.patch + +------------------------------------------------------------------- +Thu Feb 16 06:56:53 UTC 2017 - nwang@suse.com + +- bsc#1025585, upgrade to 9.0.6 + +------------------------------------------------------------------- +Fri Nov 25 10:28:35 UTC 2016 - lpechacek@suse.com + +- Excluded openSUSE from RT KMP build (bsc#1005578) + +------------------------------------------------------------------- +Wed Nov 19 11:56:17 UTC 2016 - lpechacek@suse.com + +- Enabled RT KMP build (bsc#1005578) + +------------------------------------------------------------------- +Mon Oct 24 06:35:26 UTC 2016 - nwang@suse.com + +- bsc#1006176, compat with kernel 4.8 with 9.0.5 + +------------------------------------------------------------------- +Mon Oct 24 06:33:56 UTC 2016 - nwang@suse.com + +- Upgrade 9.0.2 to 9.0.5 +- Remove patch compat-4.7-9902af79-i_mutex.patch + Remove patch compat-4.7-fe8fb75e-blk_queue_write_cache.patch + Remove patch compat-4.7-50225243-kill-nla_put_u64.patch + Remove patch compat-4.7-1dee3f59-align-nla-u64.patch + Remove patch drbd-buildcompare.patch + Remove patch kernel-4.5-compat.patch + Remove patch temp.patch + +------------------------------------------------------------------- +Wed Jun 8 06:03:05 UTC 2016 - nwang@suse.com + +- bsc#983633, upgrade to ver9.0.2 to build against kernel 4.6/4.7 +- Add patch compat-4.7-9902af79-i_mutex.patch +- Add patch compat-4.7-fe8fb75e-blk_queue_write_cache.patch +- Add patch compat-4.7-50225243-kill-nla_put_u64.patch +- Add patch compat-4.7-1dee3f59-align-nla-u64.patch + +------------------------------------------------------------------- +Fri Apr 8 14:44:21 UTC 2016 - nwang@suse.com + +- Compat with kernel 4.5 +- Add patch kernel-4.5-compat.patch + +------------------------------------------------------------------- +Mon Mar 7 14:23:53 UTC 2016 - olaf@aepfle.de + +- Remove timstamp from binaries + Add patch drbd-buildcompare.patch + +------------------------------------------------------------------- +Mon Mar 7 08:42:41 UTC 2016 - nwang@suse.com + +- Update to release drbd-9.0.1 +- Depend on drbd-utils >= 8.9.6 + +------------------------------------------------------------------- +Mon Nov 30 14:31:22 UTC 2015 - nwang@suse.com + +- Update to released drbd-9.0.0 +- Remove patch 0001-Support-zeroout-device-in-initial-sync.patch +- Remove patch update-to-8.4.6-5.patch +- Remove patch rename-GFP_WAIT-to-GFP_RECLAIM.patch +- Remove patch new-bio-struct.patch + +------------------------------------------------------------------- +Fri Nov 20 06:50:29 UTC 2015 - nwang@suse.com + +- BSC#955968, support GFP_RECLAIM in kernel4.4 +- Add rename-GFP_WAIT-to-GFP_RECLAIM.patch + +------------------------------------------------------------------- +Thu Oct 22 05:35:03 UTC 2015 - nwang@suse.com + +- BSC#950477, support new bio struct in kernel4.3 +- Add new-bio-struct.patch + +------------------------------------------------------------------- +Fri Oct 16 09:18:10 UTC 2015 - nwang@suse.com + +- BSC#950477, update to 8.4.6-5 to fix bdi congested. +- Rename 0001-drbd-Support-zeroout-device-in-initial-sync.patch + to 0001-Support-zeroout-device-in-initial-sync.patch +- Add update-to-8.4.6-5.patch + +------------------------------------------------------------------- +Fri Sep 25 04:52:12 UTC 2015 - nwang@suse.com + +- BSC#947460, add rcdrbd symlink. + +------------------------------------------------------------------- +Wed Aug 19 08:50:27 UTC 2015 - nwang@suse.com + +- Fate#317940, merge patch set into one patch. +- Support zeroout/discard-devices instead of zap-devices +- New feature flag FF_DISCARD +- Add patch 0001-drbd-Support-zeroout-device-in-initial-sync.patch +- Remove old patch set: + Patch 0000-cover-letter-fate317940.patch + Patch 0001-drbd-Fix-the-wrong-logic-of-moving-history.patch + Patch 0002-drbd-Add-options-zap_devices-to-new-current-uuid.patch + Patch 0003-drbd-A-function-to-zero-out-drbd-backing-device.patch + Patch 0004-drbd-New-packet-P_ZERO_OUT.patch + Patch 0005-drbd-Functions-to-notify-peer-node-to-start.patch + Patch 0006-drbd-Wapper-for-zeroing-out-device-by-worker.patch + Patch 0007-drbd-Flags-for-background-drbd-device-work.patch + Patch 0008-drbd-Function-to-work-with-packet-P_ZERO_OUT.patch + Patch 0009-drbd-Receive-zero-out-command-from-peer-node.patch + Patch 0010-drbd-Handle-new-current-uuid-zap-devices.patch + +------------------------------------------------------------------- +Wed Jul 29 01:03:11 UTC 2015 - nwang@suse.com + +- BSC#939778. Add obsolete of old packages and a description for + KMP package. +- Require kernel-source-rt for RT. + +------------------------------------------------------------------- +Mon Jul 20 07:52:36 UTC 2015 - nwang@suse.com + +- Fate#317940. Speed up initial sync by supporting zero out + device. + Patch 0000-cover-letter-fate317940.patch + Patch 0001-drbd-Fix-the-wrong-logic-of-moving-history.patch + Patch 0002-drbd-Add-options-zap_devices-to-new-current-uuid.patch + Patch 0003-drbd-A-function-to-zero-out-drbd-backing-device.patch + Patch 0004-drbd-New-packet-P_ZERO_OUT.patch + Patch 0005-drbd-Functions-to-notify-peer-node-to-start.patch + Patch 0006-drbd-Wapper-for-zeroing-out-device-by-worker.patch + Patch 0007-drbd-Flags-for-background-drbd-device-work.patch + Patch 0008-drbd-Function-to-work-with-packet-P_ZERO_OUT.patch + Patch 0009-drbd-Receive-zero-out-command-from-peer-node.patch + Patch 0010-drbd-Handle-new-current-uuid-zap-devices.patch +- Delete useless patch init-script-fixes.diff +- ExcludeArch i586 and s390, since user space split into + drbd-utils. + +------------------------------------------------------------------- +Fri Apr 17 06:34:51 UTC 2015 - nwang@suse.com + +- Update to 8.4.6 +- With DRBD module version 8.4.5, we split out the management tools + into their own repository. Started out as "drbd-utils version + 8.9.0". To manage DRBD 8.4.5 kernel modules and above, want + drbd-utils >= 8.9.0 +- fix failing of user space helpers since kernel 3.13. This bug is + known as 'out of mem, failed to invoke fence-peer helper' +- fix connection timeouts for resources with multiple volumes +- fix an issue with DRBD on linux software raid by properly + remapping bi_bdev +- fix a (hard to trigger) race condition between promoting to primary + an connection handshake. In case the bug was hit the Primary got + stuck in WFBitmapS connection state +- Fix a NULL deref when resuming IO on a diskless primary +- Fix compile issues with uncommon architectures +- improvements to asender performance. With high end backing storage + and networking equipment you may see IOPS improvements between + 25% to 50%. +- Highest number on a single drbd seen by LINBIT so far: 160000 IOPS +- backport of events2 and status commands from drbd9. This allows + to be DRBD9 compatible starting with this release, and to get used + to DRBD9 compatible status reporting +- support for lsblk in drbd + +- Update to 8.4.5 +- fix potential BUG_ON in mempool_alloc for older kernels (<2.6.23) +- fix cornercase of resync finished detection +- fix drbd_ldev_destroy to run exactly once and in worker context +- fix spurious detach/disconnect: don't announce WRITE_SAME +- fix NULL pointer deref in blk_add_request_payload +- (DISCARD/TRIM handling in sd) +- fix regression: potential NULL pointer dereference +- fix regression: potential list corruption +- fix regression: potential deadlock in adm functions (drbdsetup) +- fix regression: /sbin vs /usr/sbin in scripts +- fix race stopping the worker thread +- new debugfs presence expose oldest requests and other details +- userspace moved to own repository +- linux 3.13 and 3.14 compatibility +- improve adaptive resync controler +- reduce bitmap IO during resync +- allow write-ordering policy to be bumped up again +- trigger tcp_flush_pending_frames() for PING/PING_ACK +- fix potential segfault in drbdadm adjust +- drbdsetup improvements: fix netlink socket buffers; detect + modprobe failure + +------------------------------------------------------------------- +Fri May 30 04:29:22 UTC 2014 - lwang@suse.com + +- modify drbd.rules by removing NAME and adding SYMLINK in case that + configuration has a device name diffrent from kernel node (bnc#878119) + add: fix-udev-for-drbd-start-timeout.patch + +------------------------------------------------------------------- +Tue May 20 09:13:32 UTC 2014 - lmb@suse.com + +- Packages drbd-xen, drbd-utils, drbd-bash-completion, and + drbd-pacemaker were merged into drbd (bnc#878793) + +------------------------------------------------------------------- +Sun Apr 13 20:10:00 UTC 2014 - mmarek@suse.cz + +- Add # needssslcertforbuild to use the project's certificate when + building in a home project. + +------------------------------------------------------------------- +Mon Mar 31 21:44:23 UTC 2014 - rgoldwyn@suse.com + +- Add Module.supported and preamble (bnc#871132) + +------------------------------------------------------------------- +Thu Mar 27 07:40:07 UTC 2014 - xli@suse.com + +- Update to 8.4.4.7 +- fix potential BUG_ON in mempool_alloc for older kernels (<2.6.23) +- fix cornercase of resync finished detection +- fix drbd_ldev_destroy to run exactly once and in worker context +- fix spurious detach/disconnect: don't announce WRITE_SAME +- fix NULL pointer deref in blk_add_request_payload + (DISCARD/TRIM handling in sd) +- fix regression: potential NULL pointer dereference +- fix regression: potential list corruption +- fix regression: potential deadlock in adm functions (drbdsetup) +- fix regression: /sbin vs /usr/sbin in scripts +- fix race stopping the worker thread +- linux 3.13 compatibility +- improve adaptive resync controler +- reduce bitmap IO during resync +- allow write-ordering policy to be bumped up again +- trigger tcp_flush_pending_frames() for PING/PING_ACK +- new sysfs oldest_requests attribute (may be moved to debugfs) +- fix potential segfault in drbdadm adjust +- drbdsetup improvements: fix socket buffers; detect modprobe failure +- Upstream version cs: 3c1f46cb19993f98b22fdf7e18958c21ad75176d + +------------------------------------------------------------------- +Thu Mar 13 06:40:32 UTC 2014 - xli@suse.com + +- Handle drbd devices when presented as phy devices by xenstore with + libxl (bnc#865682) + + add_phy_to_block-drbd.diff + +------------------------------------------------------------------- +Wed Jan 29 13:21:11 CET 2014 - ro@suse.de + +- disable build_kmp on i586 and s390, SLE-12 does not build a + runnable kernel there + +------------------------------------------------------------------- +Mon Oct 14 09:56:15 UTC 2013 - lmb@suse.com + +------------------------------------------------------------------- +Mon Oct 14 09:27:25 UTC 2013 - lmb@suse.com + +- Update to official 8.4.4 +- drbd: evaluate disk and network timeout on different requests +- drbd: Fix a hole in the challange-response connection authentication +- drbd: always implicitly close last epoch when idle +- drbd: add back some fairness to AL transactions +- drbd: keep max-bio size during detach/attach on disconnected primary +- drbd: fix a race between start_resync and send_and_submit +- drbd: fix deadlock in discard fallback code +- Build drbd KMPs. + +------------------------------------------------------------------- +Thu Oct 10 14:04:56 UTC 2013 - lmb@suse.com + +- Update to 8.4.4rc2 +- fix potential deadlock when concurrently fencing and establishing a + connection +- fix potential distributed deadlock during verify or resync +- fix decoding of bitmap vli rle for device sizes > 64 TB +- fix for deadlock when using automatic split-brain-recovery +- only fail empty flushes if no good data is reachable +- avoid to shrink max_bio_size due to peer re-configuration +- fix resume-io after reconnect with broken fence-peer handler +- crm-fence-peer: less cib polling, peer-alive detection using crmadmin, + and other improvements +- OCF RA: avoid too tight pacemaker driven recovery loop on failed + promote, implement adjust_master_score parameter +- fix too large bursts for very slow resync rates +- don't let application IO throttle resync to a stall +- Fixed attaching to disks with fixed size external meta-data (This + regressions was introduced with 8.4.3) +- Fixed a crash when the connection broke at a very exact point in time + while a graceful disconnect executes +- Support for REQ_DISCARD +- Allow parallel promote/demote +- Allow online changing of al-stripes and al-stripe-size with the resize + command +- drbdadm adjust now deals with IP-address changes correctly +- Align the internal object model with drbd-9.0 (away from drbd-8.3) +- New drbd-proxy option "bwlimit"; allow proxy options on host level +- Compiles on Linux v3.10 + +------------------------------------------------------------------- +Wed Sep 18 09:56:22 UTC 2013 - lmb@suse.com + +- Update drbd version string in specfile so that a future 8.4.4 check-in + will be considered newer than 8.4.4rc1. +- Clean-up specfile based on spec-cleaner + +------------------------------------------------------------------- +Mon Sep 16 11:22:46 UTC 2013 - lmb@suse.com + +- Update to drbd 8.4.4rc1 +- Disable heartbeat support (heartbeat no longer ships on openSUSE) +- fix decoding of bitmap vli rle for device sizes > 64 TB +- fix for deadlock when using automatic split-brain-recovery +- only fail empty flushes if no good data is reachable +- avoid to shrink max_bio_size due to peer re-configuration +- fix resume-io after reconnect with broken fence-peer handler +- fencing script improvements +- Fixed attaching to disks with fixed size external meta-data (This + regressions was introduced with 8.4.3) +- Allow online changing of al-stripes and al-stripe-size with the resize + command +- drbdadm adjust now deals with IP-address changes correctly +- Align the internal object model with drbd-9.0 (away from drbd-8.3) +- Do not end up in Unconnected state if the connection breaks at a + certain point during the handshake (was introduced with 8.3.12) +- Closed a race condition between promoting and connection handshake, + that could lead to an inconsistent view of the peer's UUIDS +- Fixed a race condition that could lead to a full sync, if connection + breaks at a certain point while starting a regular resync +- Fixed crm-fence-peer.sh for pacemaker 1.1.8 +- Fixed a list corruption for read requests that complete with an error + after they were aborted +- Fixed a kernel panic if the device size was an exact multiple of + 128MiB +- Fixed a potential memory allocation during deadlock online resize +- Improve the handling of read-errors: Make sure that sectors that had a + read error are overwritten with data from the peer on the next resync +- Expose the data-generation-uuids through /sys/block/drbdXX/drbd/ +- The new flag --peer-max-bio-size for drbdmeta create-md is of use if + you plan to use the device for long time without peer +- Fixed a potential protocol error and resulting disconnect/reconnect, + when a disk fails on the secondary node. (Introduced with 8.4.2) +- Do not fail empty flushed on diskless, primary node +- Fixed calculation of master scores for single volume and unconfigured + resources in the drbd.ocf RA +- When the connection breaks during a grace full disconnect DRBD failed + to call the eventually configured fence-peer handler. Fixed. +- Obey md-barrier setting when changed via the disk-options command +- Non blocking queuing of AL-updates; This change significantly improves + the number of IOPs in case the workload does not fit into the + configured AL size. (Backport from drbd-9) +- New options for drbdmeta create-md --al-stripes and --al-stripe-size + to create a larger and striped AL +- Fixed drbdadm adjust of max-bio-bvecs +- Fixed a memory leak of 336 byte per attach/detach cycle +- Fix a potential null-pointer deference when configuring invalid resync + after dependencies +- Fixed IO resuming after connection was established before fence peer + handler returned +- Fixed an issue in the state engine that could cause state lockup with + multiple volumes +- Write all pages of the bitmap if it gets moved during an online resize + operation. (This issue was introduced with 8.3.10) +- Fixed a race condition could cause DRBD to go through a NetworkFailure + state during disconnect +- Fixed a race condition in the disconnect code path that could lead to + a BUG() (introduced with 8.4.0) +- Fixed a write ordering problem on SyncTarget nodes for a write to a + block that gets resynced at the same time. The bug can only be + triggered with a device that has a firmware that actually reorders + writes to the same block (merged from 8.3.13) +- Fixed a potential deadlock during restart of conflicting writes +- Disable the write ordering method "barrier" by default, since it is + not possible for a driver to find out if it works reliably since + 2.6.36 +- All fixes that went into 8.3.13 +- Removed a null pointer access when using on-congestion policy on a + diskless device +- In case of a graceful detach under IO load, wait for the outstanding + IO. (As opposed to aborting IOs as a forcefully detach does) +- Reinstate disabling AL updates with invalidate-remote (8.4.0 + regression) +- Reinstate the 'disk-barrier no', 'disk-flushes no', and 'disk-drain + no' switches (8.4.0 regression) +- Backported the request code from DRBD-9. Improves handling of many + corner cases. +- Support FLUSH/FUA bio flags +- Made the establishing of connections faster +- New option 'al-updates no' to disable writing transactions into the +- activity log. It is use full if you prefer a full sync after a primary + crash, for improved performance of a spread out random write work load +- Expose the data generation identifies via sysfs +- "--stop" option for online verify to specify a stop sector +- Fixed a bug that might cause in kernel list corruption triggered by + simultaneous IO on multiple volumes in a single resource +- Fixed a bug that might cause a kernel OOPS in the worker thread while + the receiver tied to establish a connection (drbd-8.4.0 regression) +- Fixed an issue in the receiver that could cause connection triggered + by simultaneous IO on multiple volumes in a single resource +- Consider the discard-my-data flag for all volumes +- Fixed attaching to backing devices that do not support + barriers/flushes, when barriers/flushes are not disabled by the + configuration. (drbd-8.4.0 regression) +- Fixed a rare compatibility issue with DRBD's older than 8.3.7 when + negotiating the bio_size +- Fixed a rare race condition where an empty resync could stall with if + pause/unpause events happen in parallel +- Made the re-establishing of connections quicker, if it got a broken + pipe once. Previously there was a bug in the code caused it to waste + the first successful established connection after a broken pipe event. +- crm-fence-peer.sh: Can now deal with multiple DRBD instances being in + a master/slave group +- Optional load balancing for read requests: new keyword "read-balance" + +------------------------------------------------------------------- +Mon May 13 10:44:16 CEST 2013 - ohering@suse.de + +- Make /etc/xen mode 0700 to protect vnc passwords. + +------------------------------------------------------------------- +Tue Jul 10 07:51:21 UTC 2012 - tserong@suse.com + +- Don't use /var/lock/subsys in init script (bnc#714643) + +------------------------------------------------------------------- +Fri Dec 16 03:45:16 UTC 2011 - tserong@suse.com + +- update to 8.3.11 + * Added missing spinlock in compressed bitmap receive (regression introduced + in 8.3.10, could lead to "negative" out-of-sync stats and non-terminating + resync when "use-rle" is enabled) + * Fixed handling of read errors during online verify runs + * Fixes for possible distributed deadlocks during online verify and + checksum based resync processes + * Fixed handling of IO errors with an on-io-error=pass-on policy; the + disk state goes to inconsistent + * Fixed the behavior in case ping-timeout and ping-int are set to the + same value + * Fix for connecting on high latency network links + * Fixed wrong connection drops ("PingAck did not arrive in time") with + asymmetrically congested networks + * Fixed state transitions if fence-peer handler returns after connection was + established again + * Fixes to drbdmeta and drbdsetup for the > 16TByte support + * Made negotiation of max_bio_size conservative instead of optimistic + * Network timeouts for mirrored write requests are now always enforced, + no longer only when the socket is congested + +------------------------------------------------------------------- +Sun Sep 18 17:17:12 UTC 2011 - jengelh@medozas.de + +- Remove redundant tags/sections from specfile + (cf. packaging guidelines) + +------------------------------------------------------------------- +Mon Feb 21 14:10:49 UTC 2011 - ro@novell.com + +- update to 8.3.10 + * Fixed a subtle performance degradation that might affected synchronous + work loads (databases) (introduced in 8.3.9) + * Fixed a locking regression (introduced in 8.3.9) + * Fixed on-no-data-accessible for Primary, SyncTarget nodes (Bugz 332) + * Progress bar for online verify + * Optionally use the resync speed control loop code for the online verify + process as well + * Added code to detect false positives when using data-integrity-alg + * New config option on-congestion and new connection states ahead and behind + * Reduced IO latencies during resync, bitmap exchange and temporal states + * Only build a single kernel module package on distributions that provide + the infrastructure to have kernel version independent modules + * On 64bit architectures allow device sizes up to one petabyte + +- update to 8.3.9 + * Fix for possible deadlock on IO error during resync + * Fixed a race condition between adding and removing network configuration. + Lead to a BUG_ON() when triggered. + * Fixed spurious full syncs that could happen after an empty resync and + concurrent connection loss. + * Fixed spurious full syncs that happened when connection got lost while + one node was in WFSyncUUID state (Bugz 318) + * Fixed a race in the meta-data update code path, that could lead to forgotten + updates to the meta-data. That in fact could lead to unexpected behavior + at the next connect + * Fixed potential deadlock on detach + * Fixed potential data divergence after multiple failures + * Implicitly create unconfigured devices which are referenced in sync-after + dependencies. + * OCF RA now also works with pacemaker 1.1 + * Allow BIO sizes of up to 128kByte. Note: In case drbd-proxy is used, at least + version 1.0.16 of drbd-proxy is required. + * New configuration keyword on-no-data-accessible. Possible values + io-error, and suspend-io. The default is "io-error", which matches the + previous behavior. + * If the fencing policy is set to resource-and-stonith, the primary node + will creates the new current UUID _after_ the fencing handler + returned. (Before it did immediately) + * Rewrote the resync speed control loop code. New configuration parameters + c-plan-ahead, c-fill-target, c-delay-target, c-max-rate, c-min-rate. + * Disable activity log updates when all blocks of an unconnected device is + are out of sync. That can be activated by using "invalidate-remote" on an + unconnected primary. + * Improved IPv6 support: link local addresses + * Improved resync speed display in /proc/drbd + +------------------------------------------------------------------- +Fri Oct 22 00:40:04 CEST 2010 - ro@suse.de + +- update to 8.3.8.1 + * Revert delay probes, they could potentially lead to stalled resync. + Feature is being re-implemented differently + * DRBD ocf resource agent now treats hostnames case insensitive + +- update to 8.3.8 + * Do not expose failed local READs to upper layers, regression introduced + in 8.3.3 + * Fixed support for devices with 4k hard sector size (again) + * Fixed a potential Oops in the disconnect code + * Fixed a race condition that could cause DRBD to consider the peers disk + as Inconstent after resync instead of UpToDate (Bugz 271) + * Fixed a reace condition that could cause DRBD to consider the peers disk + as Outdated instead of Inconsistent during resync (Bugz 277) + * Disallow to start a resync with invalidate / invalidate-remote when the + source disk is not UpToDate + * Forcing primary works now also for Consistent, not only for Outdated and + Inconsistent (Bugz 266) + * Improved robustness against corrupt or malicous sector addresses when + receiving data + * Added the initial-split-brain, it gets called also if the split-brain gets + automatically resolved + * Added the --assume-clean option for the resize command, it causes drbd to + not resync the new storage after an online grow operation + * drbdadm: Do not segfault if stacked-on-top-of refers to an undefined res + * drbdadm: Do not consider configs with invalid after statements as invalid + * drbdadm: Do not segfault if the peer's proxy section is missing + * drbdadm: Allow nullglob in include statement + * drbdadm: Fixed the use of waitpid + * init script: fix insserv headers (Debian 576901) + * Gave the receiving code the ability to use multiple BIOs for writing a + single data packet; now DRBD works with BIOs up to 32kByte also on LVM + devices; from now on the use_bmbv config option does nothing + * New command check-resize, that allows DRBD to detect offline resizing + and to move internal meta-data accordingly + * Added a control loop, that allows DRBD to find auto tune the resync + speed, on connections with large queues (drbd-proxy) + * --dry-run option for connect; disconnects after sync handshake + * --overwrite-data-of-peer got an alias named --force + * Improvements to crm-fence-peer + * Fixed option parsing and stacking in snapshot-resync-target-lvm.sh + * Compiles on 2.6.33 and 2.6.34 + +- removed patches: + 64bit-fixes.diff (upstream/obsolete) + +------------------------------------------------------------------- +Fri Jun 25 05:39:10 UTC 2010 - tserong@novell.com + +- Include Linbit RA + +------------------------------------------------------------------- +Sun Apr 11 14:29:39 CEST 2010 - dmueller@suse.de + +- remove KMP subpackage, the kernel modules are part of the kernel + and don't build out of tree anymore + +- update to 8.3.7: + * Lots of fixes to the new RPM packaging + * Lots of fixes to the autoconfig stuff + * Following the rename of CONFIG_LBD to CONFIG_LBDAF + * Silenced an assert. Could trigger after changing write ordering (Bugz 261) + * Fixed a race condition between detach and ongoing IO. Very hard to + trigger, caused an OOPS in make_request/drbd_make_request. (Bugz 262) + * Fixed a regression in the resync handshake code introduced before 8.3.3. + That bug causes DRBD to block during the initial handshake when a partial + resync is not possible but a full resync is necessary. Happens very rarely. + (Bugz 260) + * Do not drop into StandAlone mode when connection is lost during authentication + * Corrected a null test in the authentication code, found by conccinelle, + thanks to upstream integration. The chance to trigger that was probably 10^-9. + * crm-fence-peer.sh is now also usable if DRBD is managed from the xen block + helper script + * Fixes to the init script's dependencies + * Backported cleanups that where contributed to the in kernel DRBD + * Allow online resizing of disconnected devices, new option to drbdsetup + drbdsetup /dev/drbdX resize --assume-peer-has-space + * Allow multiple after options in the syncer section for stacked setups + * Correctly process relative paths in include statements in drbd.conf + * New option (-t) for drbdadm to test syntax of config snippets + * Following Linux upstream changes 2.6.32 (SHASH and in_flight issues) + * New /etc/drbd.conf example that suggests the use of /etc/drbd.d/xxx.res + * Fixed a regression introduced shortly before 8.3.3, which might + case a deadlock in DRBD's disconnect code path. (Bugz 258) + * Fixed drbdsetup X resume-io which is needed for the recovery + from the effects of broken fence-peer scripts. (Bugz 256) + * Do not reduce master score of a current Primary on connection loss, + to avoid unnecessary migrations + * Do not display the usage count dialog for /etc/inti.d/drbd status + +------------------------------------------------------------------- +Fri Jan 8 16:54:23 CET 2010 - vuntz@opensuse.org + +- Remove unneeded glib-devel BuildRequires. + +------------------------------------------------------------------- +Wed Oct 7 19:16:37 UTC 2009 - aj@suse.de + +- update to 8.3.4: + * Support kernel 2.6.31 + * Numerous bug fixes + * Support for Infiniband via SDP (sockets direct protocol) +- Add build fix from upstream. + +------------------------------------------------------------------- +Sun Jul 19 21:51:40 CEST 2009 - coolo@novell.com + +- trying to get installation right + +------------------------------------------------------------------- +Tue Jul 14 12:13:04 CEST 2009 - teelynn19@aim.com + +- update to 8.3.2 + * For kernel 2.6.30 support - see internal changelog of source + +------------------------------------------------------------------- +Mon Apr 20 01:13:04 CEST 2009 - ro@suse.de + +- update to 8.3.1 + * Fixed drbdadm invalidate on disconnected devices (reg in 8.2.7) + * Fixed a hard to trigger spinlock deadlock when using device stacking + with the upper device having a smaller minor number than the lower device. + (Bugz 210) + * Adding a missing range check in ensure_mdev() + * Implemented a congested_fn; the kernel can keep its pdflushes running now + * Improvements the connection code for high latency links + * Fix for several potential memory leaks when allocating a device + * Use an additional meta data bit to store the fact of an old crashed primary + * Udev rule that populates /dev/drbd/by-res/ and /dev/drbd/by-disk/ + * New timeout option: outdated-wfc-timeout + * New drbdmeta option: --ignore-sanity-checks + * Include statement for drbd.conf + * Improvements to drbd-overview.pl + * Fixed snapshot-resync-target-lvm.sh to work with more than 10 devices + * Do not force a full resync after a detach on a primary node + * Compatibility with Linux 2.6.27, 2.6.28 and 2.6.29 + +- update to 8.3.0 + * Fixed 'sleep with spinlock held' in case online verify found a difference + * Fixed error code pathes in request processing. + * Fix for stack smashing in drbdmeta + * Fixed a bug that could lead to a crash when detaching/attaching + on the primary under heavy IO (Bugz 171) + * Fixed a bug in the new epoch code (introduced with 8.2.7). + Might cause crash at reconnect after connection loss during heavy IO + (Bugz 160) + * Fixed a bug in drbdsetup that could cause drbdsetup wait-connect to + miss the connection event. + * Fixed a race condition in the new barrier code. (Reordered barrier ACKs) + * Do not rely on blkdev_issue_flush() returning ENOTSUPP + * bitmap in unmapped pages = support for devices > 4TByte (was DRBD+) + * checksum based resync (was DRBD+) + * support for stacked resource (was DRBD+) + * Added support for stacked resources to the bash completion stuff + * Added missing documentation (manpages) + * Fixed drbdadm handlers for stacked resources + * Support of drbd-proxy in stacked setups + * RedHat cluster suite (rgmanager) integration scripts + * Renamed 'state' to 'role' + * More build compatibility with older vendor kernels + * Added drbd-overview.pl to the packages + +- update filelist + +------------------------------------------------------------------- +Tue Jan 13 14:16:41 CET 2009 - dgollub@suse.de + +- Add kernel-syms-rt to build requires to build SLERT KMPs + +------------------------------------------------------------------- +Wed Dec 10 13:30:00 CET 2008 - lmb@suse.de + +- Update with changes from 8a9ba53abe973301639beacc55eec569b43507e5: +- Fix buffer overflow and off-by-one errors in drbd user-space token + parser (bnc#450883). +- Fix resizing of devices. +- Fix a NULL pointer dereference in barrier handling. +- Handle failing request better. +- Race in UUID synchronization. +- Fix a call to a blocking function from within a spinlock. +- drbd-optflags.patch: removed, is now upstream. + +------------------------------------------------------------------- +Fri Nov 21 14:00:00 CET 2008 - lmb@suse.de + +- Update from 8.2.7-rc1 to 8.2.7 proper. +- Endianness fixes. +- Handle out-of-sequence barrier acks. +- Allow DRBD to user other cn_idx values in case our default value is + already taken. +- Although Primary/Diskless/StandAlone is invalid it is not unconfigured +- become UpToDate on both after detach-attach on a connected secondary + device pair +- 2.6.28 compatibility (needed for SLE11 kernel) +- Bugfixes to write barrier handling. + +------------------------------------------------------------------- +Mon Oct 27 14:00:00 CET 2008 - lmb@suse.de + +- Include fixes from upstream + (0e87a13b63e2ef87af6cfcc0d875721c53f37ed9). +- Fixed possible Oops on connection loss during sync handshake. +- Latency improvements. +- Improved barrier support. + +------------------------------------------------------------------- +Thu Sep 4 12:13:27 CEST 2008 - lmb@suse.de + +- Imported some changes from upstream, including: +- Made it to compile on Linux-2.6.26 +- Fixed online resizing if there is application IO on the fly when the + resize is triggered. +- Fixed online resizing if it is triggered from the secondary node. +- Fixed a possible deadlock in case "become-primary-on-both" is used, and + a resync starts +- Fixed the invocation of the pri-on-incon-degr handler +- Fixed the exit codes of drbdsetup +- sock_create_lite() to avoid a socket->sk leak +- Auto-tune socket buffers if sndbuf-size is set to zero + +------------------------------------------------------------------- +Mon Aug 18 18:07:48 CEST 2008 - mrueckert@suse.de + +- remove outdated options in the fillup_and_insserv call + +------------------------------------------------------------------- +Mon Aug 18 11:26:43 CEST 2008 - schwab@suse.de + +- Fix name of completions file. + +------------------------------------------------------------------- +Tue Jul 15 09:41:31 CEST 2008 - lmb@suse.de + +- Update to 8.2.6 and include all bugfixes from upstream. +- Fix loading of module (bnc#403731). +- Include bash completion for drbdadm. +- Added the before-resync-target handler. +- Fixed the out-of-sync handler. +- Added the max-bio-bvecs option to workaround issues in a stack of + DRBD/LVM/Xen. +- Fix online resizing in case if triggered from secondary. +- Includes bugfixes from 8.0.11 -> 8.0.12 branch. + +------------------------------------------------------------------- +Wed Jun 4 12:04:56 CEST 2008 - ro@suse.de + +- buildreq xen-tools only on x86,x86_64 + +------------------------------------------------------------------- +Tue Jun 3 21:57:39 CEST 2008 - coolo@suse.de + +- avoid packaging a directory of xen-tools with different permissions + +------------------------------------------------------------------- +Tue Apr 15 15:03:25 CEST 2008 - lmb@suse.de + +- Update to 8.2.5 (FATE#302403) +- Include online-verify + various fixes to it. +- Fix races between online-verify and application writes. +- Fixed data-integrity-alg features. +- Improved latency. +- Full support for migration of meta-data from 0.7 -> 0.8. +- Fix some more races, bugs, and memory leaks. + +------------------------------------------------------------------- +Wed Dec 5 15:03:58 CET 2007 - ro@suse.de + +- hack to compile with 2.6.24 + +------------------------------------------------------------------- +Tue Sep 18 12:07:34 CEST 2007 - ro@suse.de + +- do really build a module + +------------------------------------------------------------------- +Mon Sep 17 14:41:31 CEST 2007 - lmb@suse.de + +- Update to drbd 8.0.6 for kernel-compatibility (310187) + +------------------------------------------------------------------- +Wed Apr 4 22:13:20 CEST 2007 - lrupp@suse.de + +- added module-init-tools to BuildRequires + +------------------------------------------------------------------- +Fri Mar 30 15:20:11 CEST 2007 - rguenther@suse.de + +- add flex BuildRequires +- add /etc/modprobe.d directory + +------------------------------------------------------------------- +Fri Mar 30 02:26:42 CEST 2007 - ro@suse.de + +- added bison to buildreq + +------------------------------------------------------------------- +Mon Jan 15 09:43:01 CET 2007 - lmb@suse.de + +- Update to 0.7.23 for Linux kernels >2.6.19. + +------------------------------------------------------------------- +Mon Oct 30 23:33:13 CET 2006 - lmb@suse.de + +- Update to the officially released 0.7.22 version. +- Implement "freeze_io" feature. +- convert-MODULE_PARM.diff: drop unneeded patch. + +------------------------------------------------------------------- +Fri Oct 6 14:03:21 CEST 2006 - lmb@suse.de + +- Update to 0.7.22: + - In protocol A and B, on connection loss, drbd could "forget" to set + certain areas out of sync. + - fix races between failure in drbd_send_dblock and concurrently + running tl_clear. + - fix potential access-afer-free in drbd_dio_end. + - fix possible list corruption respective resulting deadlock in + receive_DataRequest. + - improved the drbd_thread_stop / start code. + +------------------------------------------------------------------- +Mon Aug 14 21:44:10 CEST 2006 - lmb@suse.de + +- Update to 0.7.21. + * Fixed the "syncer stalled" after reconnect symptom. + * Fixed the "stalled in WFParams" after reconnect symptom. The cause + of this bug was actually a misuse of the data socket. + * Allow to set the uplug_watermark to 1, only usefull for very strange + cases. + * The GC comparison code failed to start a resync in case the two + cluster node failed simultaniously (common power failure). + * Fixed DRBD's code to start kernel threads to work on 2.6.17 also. + * IOCTL return codes fixed for 32bit userland - 64 bit kernel + setups. + * New config option "unplug-watermark". + * Released the drbd_alloc_ee() / drbd_free_ee() implementation from + the DRBD+ branch to the main branch. + * Fixed a bug where lc_del() left a list poison in an LRU chache's + hash table. The only way to trigger this bug was: + up (>>200M), primary, mkfs, resize to 200M, down, up + * DRBD now propagates the backing storage's read ahead properties + to upper layers. With devices that read very fast, this is + important. + * GFP_KERNEL was changed to GFP_NOIO in a few places, to make it + more save against deadlocks in the memory subsystem. + +------------------------------------------------------------------- +Thu May 4 17:10:38 CEST 2006 - lmb@suse.de + +- Import fixes from 0.7.18: +- Under high memory pressure it was possible to hit a deadlock on a + kmalloc(). Changed the GFP mask, it is no longer possible to deadlock + it with memory pressure. +- With very unlucky network timing during connect DRBD falls into a + connect / drop-connection loop, that as soon as DRBD is in this loop + is very stable. This is fixed now, DRBD detects this situation an + breaks out of it. +- Fix to the init-script. Now it waits until udev has created the device + nodes of _all_ resources. +- A small fix for the 32bit userland 64bit kernel people, running older + kernels. +- Improved handling of IO errors during initial read in of the activity + log. + +------------------------------------------------------------------- +Sun Apr 2 20:01:34 CEST 2006 - agruen@suse.de + +- convert-MODULE_PARM.diff: Convert from the obsolete MODULE_PARM + to the new module_param. + +------------------------------------------------------------------- +Mon Mar 27 17:43:40 CEST 2006 - lmb@suse.de + +- Fix memory allocation flags for the activity log (GFP_KERNEL -> + GFP_NOIO) to avoid possible deadlock. + +------------------------------------------------------------------- +Mon Mar 6 17:09:05 CET 2006 - lmb@suse.de + +- Import upstream fixes from 0.7.17: + - There was a bug that could cause the activity log to be not applied + after a primary crash, when an other size than 127 elements was + configured. + - There was a bug in the activity log code, that could cause that the + latest update to the AL is omitted at recovery time. + - The "Marked additional XXKB as out-of-synced based on AL." message + showed one one eighth of the real amount. + +------------------------------------------------------------------- +Thu Feb 16 16:41:19 CET 2006 - lmb@suse.de + +- Update to 0.7.16, new fixes: + - DRBD no longer shrinks an consistent device if it gets connected to + an smaller peer or attached to a smaller disk. + - There was a bug related to the degr-wcf-timeout config option, it was + never used in recent DRBD releases. Fixed. + +------------------------------------------------------------------- +Fri Feb 3 11:59:29 CET 2006 - agruen@suse.de + +- drbd.spec: Replace %arch with %_target_cpu. + +------------------------------------------------------------------- +Thu Feb 2 12:04:52 CET 2006 - ro@suse.de + +- added KMP subpackage (required with suse_kernel_module_package) + +------------------------------------------------------------------- +Tue Jan 31 15:04:10 CET 2006 - lmb@suse.de + +- Change km_drbd to a KMP. +- Import fix to deal with serialized recursive calls to + generic_make_request() and avoid a deadlock (SVN r2056). + +------------------------------------------------------------------- +Thu Jan 26 12:25:02 CET 2006 - lmb@suse.de + +- Compile fix for 2.6.16-rc1. + +------------------------------------------------------------------- +Wed Jan 25 21:35:35 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Mon Jan 23 17:57:02 CET 2006 - lmb@suse.de + +- Import some updated documentation. + +------------------------------------------------------------------- +Tue Dec 20 14:14:54 CET 2005 - lmb@suse.de + +- Update to 0.7.15. + +------------------------------------------------------------------- +Thu Dec 1 15:57:58 CET 2005 - lmb@suse.de + +- Update to 0.7.14/SVN. + +------------------------------------------------------------------- +Thu Sep 1 12:18:25 CEST 2005 - lmb@suse.de + +- Switch to stable version 0.7.13. + +------------------------------------------------------------------- +Thu Jun 30 09:43:19 CEST 2005 - meissner@suse.de + +- use RPM_OPT_FLAGS correctly. + +------------------------------------------------------------------- +Mon Feb 21 18:08:00 CET 2005 - lmb@suse.de + +- Update to upstream 0.8_pre1 (SVN 1763). + +------------------------------------------------------------------- +Wed Feb 2 18:42:01 CET 2005 - lmb@suse.de + +- Update to upstream 0.7.10 (1754). + +------------------------------------------------------------------- +Fri Jan 14 01:32:35 CET 2005 - ro@suse.de + +- fix typo in specfile + +------------------------------------------------------------------- +Wed Dec 1 14:51:29 CET 2004 - lmb@suse.de + +- Update to upstream version 0.7.6. + +------------------------------------------------------------------- +Mon Sep 20 15:54:07 CEST 2004 - lmb@suse.de + +- Merge fixes from SLES9 SP1 with STABLE. + +------------------------------------------------------------------- +Fri Sep 3 15:36:21 CEST 2004 - lmb@suse.de + +- Realign with upstream. + +------------------------------------------------------------------- +Fri Aug 27 12:41:43 CEST 2004 - lmb@suse.de + +- Allow invalidate if cstate to +- changed neededforbuild to + +------------------------------------------------------------------- +Wed Oct 2 14:23:53 CEST 2002 - jg@suse.de + +- Updated to 0.6.1-pre17, changes: + - Merged syncer speedup code by Lars G. Ellenberg + - Merged most of Lars' modifications to the ioctl interface + - Marged the bug-fixes from the lge-branch + - Implemented the TimoutCounter in the meta-data code. + - Fixed a bug that could cause lockup of the primary node on + SMP systems using a SCSI device for DRBD, it always happened + during resynchronisation. (!) +- Checking /.buildenv now in buildsystem instead of /etc/*-release + +------------------------------------------------------------------- +Tue Sep 3 18:18:48 CEST 2002 - jg@suse.de + +- Init script fixes: + - Removed abortion on non existing block devices (may + break LVM setups) + - Sourcing . /etc/rc.status earlier now + - Allowing execution via rcdrbd link + +------------------------------------------------------------------- +Mon Sep 2 22:09:22 CEST 2002 - jg@suse.de + +- Incorporated latest changes from CVS +- Using lge branch now (syncer much faster) + +------------------------------------------------------------------- +Wed Aug 21 10:32:08 CEST 2002 - jg@suse.de + +- Fixed manpage generation (should now even build on ppc64) + +------------------------------------------------------------------- +Tue Aug 20 11:17:55 CEST 2002 - jg@suse.de + +- Added PreReq tag + +------------------------------------------------------------------- +Mon Aug 19 12:07:53 CEST 2002 - kukuk@suse.de + +- fix compilation on UL + +------------------------------------------------------------------- +Tue Aug 13 15:28:49 CEST 2002 - jg@suse.de + +- Added documentation stuff again +- Modified init script to comply with LSB + +------------------------------------------------------------------- +Mon Aug 12 15:18:40 CEST 2002 - jg@suse.de + +- Updated to latest version from CVS repository +- Removed temporary documentation path from Makefile (does + not build) + +------------------------------------------------------------------- +Tue Mar 5 08:38:28 CET 2002 - jg@suse.de + +- Fixed broken specfile + +------------------------------------------------------------------- +Mon Mar 4 17:37:13 CET 2002 - jg@suse.de + +- updated to bugfix release 0.6.1pre10 + - Data-corruption bug in SyncAll fixed (was introduced in pre9) + - Fixed an OOPS in tl_check_sector() (was introduced in pre9) + - Fixed Linux-2.2.x compability (was broken in pre9) +- removed documentation patch (not needed anymore) + +------------------------------------------------------------------- +Wed Feb 20 18:14:04 CET 2002 - jg@suse.de + +- modified init script to honor inittimeout settings + +------------------------------------------------------------------- +Wed Feb 20 17:55:05 CET 2002 - jg@suse.de + +- added -include /usr/src/linux/include/linux/modversions.h + to km_drbd Makefile in case CONFIG_MODVERSIONS is set +- modified the init script to comply to LSB and to skip + the "interactive" part on boot + +------------------------------------------------------------------- +Tue Feb 12 15:47:56 CET 2002 - jg@suse.de + +- added -DMODVERSION and -D__SMP__ to km_drbd Makefile (according + to kernel configuration) + +------------------------------------------------------------------- +Fri Feb 1 00:26:06 CET 2002 - ro@suse.de + +- changed neededforbuild to + +------------------------------------------------------------------- +Tue Jan 29 18:26:07 CET 2002 - jg@suse.de + +- updated to 0.6.1-pre9 + +------------------------------------------------------------------- +Thu Dec 20 10:22:14 CET 2001 - jg@suse.de + +- replaced insserv call in specfile with respective macro + +------------------------------------------------------------------- +Wed Dec 19 21:01:42 CET 2001 - jg@suse.de + +- updated to 0.6.1-pre7 (supports now kernel 2.4) +- removed insserv call after installing +- removed fillup template +- removed some outdated documentation files + +------------------------------------------------------------------- +Fri Jul 27 17:21:10 MEST 2001 - mt@suse.de + +- fixed init script to be LSB compliant + +------------------------------------------------------------------- +Fri Jul 20 12:06:42 CEST 2001 - kukuk@suse.de + +- changed neededforbuild to +- changed neededforbuild to +- changed neededforbuild to + +------------------------------------------------------------------- +Sun Jan 14 11:01:43 CET 2001 - mt@suse.de + +- added km_drbd subpackage with drbd kernel module source + +------------------------------------------------------------------- +Fri Dec 1 14:07:17 CET 2000 - mt@suse.de + +- added mkdir $RPM_BUILD_ROOT/sbin in spec + +------------------------------------------------------------------- +Fri Dec 1 10:43:41 CET 2000 - kukuk@suse.de + +- move sbin/init.d -> etc/init.d + +------------------------------------------------------------------- +Mon Nov 27 12:45:16 CET 2000 - mt@suse.de + +- fixed link src for rcdrbd in spec file +- changed group to Applications/Clustering + +------------------------------------------------------------------- +Thu Nov 23 09:42:31 CET 2000 - mt@suse.de + +- removed heartbeat from neededforbuild + +------------------------------------------------------------------- +Wed Nov 22 13:40:05 CET 2000 - mt@suse.de + +- changed to LSB installation of run level links + +------------------------------------------------------------------- +Fri Nov 10 16:01:54 CET 2000 - mt@suse.de + +- no module build in spec - drbd module is patched into the kernel + +------------------------------------------------------------------- +Wed Nov 8 10:42:33 CET 2000 - mt@suse.de + +- new package + diff --git a/drbd.spec b/drbd.spec new file mode 100644 index 0000000..430391b --- /dev/null +++ b/drbd.spec @@ -0,0 +1,144 @@ +# +# spec file for package drbd +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# +# needssslcertforbuild + + +# RT enabled in Leap15.2(but not in Tumbleweed) +%if ! 0%{?is_opensuse} || 0%{?sle_version} >= 150200 +%ifarch x86_64 +%define buildrt 1 +%endif +%endif + +Name: drbd +Version: 9.1.16 +Release: 0 +Summary: Linux driver for the "Distributed Replicated Block Device" +License: GPL-2.0-or-later +URL: https://drbd.linbit.com/ +Source: %{name}-%{version}.tar.gz +Source1: preamble +Source2: Module.supported +Source3: drbd_git_revision + +Patch1: bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch +Patch2: 0006-drbd-log-numeric-value-of-drbd_state_rv-as-well-as-s.patch +Patch3: 0008-compat-block-introduce-holder-ops.patch +Patch4: 0011-compat-block-pass-a-gendisk-to-open.patch +Patch5: 0013-drbd-remove-unused-extern-for-conn_try_outdate_peer.patch +Patch6: 0014-drbd-include-source-of-state-change-in-log.patch +Patch7: 0015-compat-block-use-the-holder-as-indication-for-exclus.patch +Patch8: 0018-drbd-rework-autopromote.patch +Patch9: 0019-compat-block-remove-the-unused-mode-argument-to-rele.patch +Patch10: 0022-compat-block-replace-fmode_t-with-a-block-specific-t.patch +Patch11: 0023-compat-genetlink-remove-userhdr-from-struct-genl_inf.patch +Patch12: bsc-1216666-compat-sock-Remove-sendpage-in-favour-of-sendmsg-MSG.patch +Patch99: suse-coccinelle.patch + +#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py +BuildRequires: coccinelle >= 1.0.8 +BuildRequires: kernel-source +BuildRequires: kernel-syms +BuildRequires: libelf-devel +BuildRequires: modutils +BuildRequires: %kernel_module_package_buildreqs +Requires: drbd-utils >= 9.3.0 +Supplements: drbd-utils >= 9.3.0 +Obsoletes: drbd-kmp < %{version} +ExcludeArch: i586 s390 +%kernel_module_package -n drbd -p %{_sourcedir}/preamble +%if 0%{?buildrt} == 1 +BuildRequires: kernel-source-rt +BuildRequires: kernel-syms-rt +%endif + +%description +DRBD is a distributed replicated block device. It mirrors a block +device over the network to another machine. Think of it as networked +raid 1. It is a building block for setting up clusters. + +%package KMP +Summary: Kernel driver +URL: http://drbd.linbit.com/ + +%description KMP +This module is the kernel-dependent driver for DRBD. This is split out so +that multiple kernel driver versions can be installed, one for each +installed kernel. + +%prep +%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 +%patch11 -p1 +%patch12 -p1 +%patch99 -p1 + +mkdir source +cp -a drbd/. source/. || : +cp $RPM_SOURCE_DIR/drbd_git_revision source/.drbd_git_revision + +%build +rm -rf obj +mkdir obj +ln -s ../scripts obj/ + +export WANT_DRBD_REPRODUCIBLE_BUILD=1 +export CONFIG_BLK_DEV_DRBD=m +export EXTRA_CFLAGS='-DVERSION=\"%{version}\"' +# Unset SPAAS or set as 'true' will use `spatch-as-a-service` from drbd.io +# when "coccinelle" not installed. Set SPAAS to 'false' to force an ERROR. +export SPAAS='false' + +for flavor in %{flavors_to_build}; do + rm -rf $flavor + cp -a -r source $flavor + cp -a %{_sourcedir}/Module.supported $flavor + export DRBDSRC="$PWD/obj/$flavor" + # bsc#1160194, check the coccicheck work. + #make coccicheck + make %{?_smp_mflags} -C %{kernel_source $flavor} modules M=$PWD/$flavor SPAAS=${SPAAS} + + # Check the compat result + cat $PWD/$flavor/compat.h +done + +%install +export INSTALL_MOD_PATH=%{buildroot} +export INSTALL_MOD_DIR=updates +for flavor in %{flavors_to_build}; do + make -C %{kernel_source $flavor} modules_install M=$PWD/$flavor +done + +mkdir -p %{buildroot}/%{_sbindir} +ln -s -f %{_sbindir}/service %{buildroot}/%{_sbindir}/rc%{name} +rm -f drbd.conf + +%files +%license COPYING +%doc ChangeLog +%{_sbindir}/rc%{name} + +%changelog diff --git a/drbd_git_revision b/drbd_git_revision new file mode 100644 index 0000000..634f6fa --- /dev/null +++ b/drbd_git_revision @@ -0,0 +1 @@ +GIT-hash: 288abda1fb8c93e385960af01ab28729fefdaa38 diff --git a/preamble b/preamble new file mode 100644 index 0000000..4f48fba --- /dev/null +++ b/preamble @@ -0,0 +1,3 @@ +Requires: kernel-%1 +Supplements: packageand(kernel-%1:%name) +Recommends: drbd diff --git a/suse-coccinelle.patch b/suse-coccinelle.patch new file mode 100644 index 0000000..8ffdb7b --- /dev/null +++ b/suse-coccinelle.patch @@ -0,0 +1,76 @@ +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 +@@ -67,7 +77,15 @@ + < drbd-kernel-compat/cocci/debugfs_compat_template.cocci.in \ + >> $incdir/.compat.cocci + done ++ ++ coccilibpath=$(rpm -ql coccinelle|grep standard.h|xargs dirname); ++ echo " SPATCH_SOURCES: "$*; ++ echo " COCCI_LIBPATH: "$coccilibpath; ++ + if [ -e $incdir/.compat.cocci ]; then ++ echo " GENCOCCIRULES .compat.cocci"; ++ cat $incdir/.compat.cocci; ++ + 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 ++ + mv $compat_patch.tmp $compat_patch + # keep it around + # to better be able to match the "stderr" warnings to their source files