diff --git a/Fix-no-bitmap-allocate-for-stacked-res.patch b/Fix-no-bitmap-allocate-for-stacked-res.patch new file mode 100644 index 0000000..3a3d291 --- /dev/null +++ b/Fix-no-bitmap-allocate-for-stacked-res.patch @@ -0,0 +1,108 @@ +From b5eab810ded459792c24a4bc5db5ce272ea1ee15 Mon Sep 17 00:00:00 2001 +From: Philipp Reisner +Date: Fri, 26 Jan 2018 16:09:01 +0100 +Subject: [PATCH] v9,drbdadm,stacking: Fix setting the disk in stacked host +sections + +This got broken on the long way from drbd-8.4 to 9. +--- + +diff --git a/user/v9/drbdadm_postparse.c b/user/v9/drbdadm_postparse.c +index 1cefd5c2..b9e90de8 100644 +--- a/user/v9/drbdadm_postparse.c ++++ b/user/v9/drbdadm_postparse.c +@@ -493,9 +493,9 @@ void set_peer_in_resource(struct d_resource* res, int peer_required) + add_no_bitmap_opt(res); + } + +-void set_disk_in_res(struct d_resource *res) ++void set_stacked_disk_in_res(struct d_resource *res) + { +- struct d_host_info *host; ++ struct d_host_info *host, *lower_host; + struct d_volume *a, *b; + + if (res->ignore) +@@ -505,41 +505,39 @@ void set_disk_in_res(struct d_resource *res) + if (!host->lower) + continue; + +- if (host->lower->ignore) +- continue; +- +- check_volume_sets_equal(res, host, host->lower->me); +- if (!config_valid) +- /* don't even bother for broken config. */ +- continue; ++ for_each_host(lower_host, &host->lower->all_hosts) { ++ check_volume_sets_equal(res, host, lower_host); ++ if (!config_valid) ++ /* don't even bother for broken config. */ ++ continue; + +- /* volume lists are sorted on vnr */ +- a = STAILQ_FIRST(&host->volumes); +- b = STAILQ_FIRST(&host->lower->me->volumes); +- while (a) { +- while (b && a->vnr > b->vnr) { +- /* Lower resource has more volumes. +- * Probably unusual, but we decided +- * that it should be legal. +- * Skip those that do not match */ +- b = STAILQ_NEXT(b, link); +- } +- if (a && b && a->vnr == b->vnr) { +- if (b->device) +- m_asprintf(&a->disk, "%s", b->device); +- else +- m_asprintf(&a->disk, "/dev/drbd%u", b->device_minor); +- /* stacked implicit volumes need internal meta data, too */ +- if (!a->meta_disk) +- m_asprintf(&a->meta_disk, "internal"); +- if (!a->meta_index) +- m_asprintf(&a->meta_index, "internal"); +- a = STAILQ_NEXT(a, link); +- b = STAILQ_NEXT(b, link); +- } else { +- /* config_invalid should have been set +- * by check_volume_sets_equal */ +- assert(0); ++ a = STAILQ_FIRST(&host->volumes); ++ b = STAILQ_FIRST(&lower_host->volumes); ++ while (a) { ++ while (b && a->vnr > b->vnr) { ++ /* Lower resource has more volumes. ++ * Probably unusual, but we decided ++ * that it should be legal. ++ * Skip those that do not match */ ++ b = STAILQ_NEXT(b, link); ++ } ++ if (a && b && a->vnr == b->vnr) { ++ if (b->device) ++ m_asprintf(&a->disk, "%s", b->device); ++ else ++ m_asprintf(&a->disk, "/dev/drbd%u", b->device_minor); ++ /* stacked implicit volumes need internal meta data, too */ ++ if (!a->meta_disk) ++ m_asprintf(&a->meta_disk, "internal"); ++ if (!a->meta_index) ++ m_asprintf(&a->meta_index, "internal"); ++ a = STAILQ_NEXT(a, link); ++ b = STAILQ_NEXT(b, link); ++ } else { ++ /* config_invalid should have been set ++ * by check_volume_sets_equal */ ++ assert(0); ++ } + } + } + } +@@ -1140,7 +1138,7 @@ void post_parse(struct resources *resources, enum pp_flags flags) + // Needs "me" set already + for_each_resource(res, resources) + if (res->stacked_on_one) +- set_disk_in_res(res); ++ set_stacked_disk_in_res(res); + + for_each_resource(res, resources) + fixup_peer_devices(res); diff --git a/Support-pass-force-to-dump-md.patch b/Support-pass-force-to-dump-md.patch new file mode 100644 index 0000000..4528660 --- /dev/null +++ b/Support-pass-force-to-dump-md.patch @@ -0,0 +1,48 @@ +drbdadm : Support pass force option to dump md + +At least till v8.9.6, drbdadm dump-md support +"--force" option to dump the metadata (might +stale) while the device still running. + +drbdmeta still able to dump but drbdadm +will show "unrecognized option" + +diff -Naur drbd-utils-9.0.0.orig/user/v9/config_flags.c drbd-utils-9.0.0/user/v9/config_flags.c +--- drbd-utils-9.0.0.orig/user/v9/config_flags.c 2018-01-25 10:49:04.419550855 +0800 ++++ drbd-utils-9.0.0/user/v9/config_flags.c 2018-01-25 10:51:53.412986007 +0800 +@@ -1081,6 +1081,12 @@ + { } }, + }; + ++struct context_def dump_md_ctx = { ++ .fields = { ++ { .name = "force", .argument_is_optional = true }, ++ { } }, ++}; ++ + struct context_def adjust_ctx = { + .fields = { + { "skip-disk", .argument_is_optional = true }, +diff -Naur drbd-utils-9.0.0.orig/user/v9/config_flags.h drbd-utils-9.0.0/user/v9/config_flags.h +--- drbd-utils-9.0.0.orig/user/v9/config_flags.h 2018-01-25 10:49:04.419550855 +0800 ++++ drbd-utils-9.0.0/user/v9/config_flags.h 2018-01-25 10:51:37.420850181 +0800 +@@ -100,6 +100,7 @@ + extern struct context_def device_options_ctx; + extern struct context_def invalidate_ctx; + extern struct context_def create_md_ctx; ++extern struct context_def dump_md_ctx; + extern struct context_def adjust_ctx; + extern struct context_def peer_device_options_ctx; + extern struct context_def handlers_ctx; +diff -Naur drbd-utils-9.0.0.orig/user/v9/drbdadm_main.c drbd-utils-9.0.0/user/v9/drbdadm_main.c +--- drbd-utils-9.0.0.orig/user/v9/drbdadm_main.c 2018-01-25 10:49:04.419550855 +0800 ++++ drbd-utils-9.0.0/user/v9/drbdadm_main.c 2018-01-25 10:49:44.659892592 +0800 +@@ -357,7 +357,7 @@ + static struct adm_cmd create_md_cmd = {"create-md", adm_create_md, &create_md_ctx, ACF1_MINOR_ONLY }; + static struct adm_cmd show_gi_cmd = {"show-gi", adm_setup_and_meta, ACF1_PEER_DEVICE .disk_required = 1}; + static struct adm_cmd get_gi_cmd = {"get-gi", adm_setup_and_meta, ACF1_PEER_DEVICE .disk_required = 1}; +-static struct adm_cmd dump_md_cmd = {"dump-md", adm_drbdmeta, ACF1_MINOR_ONLY }; ++static struct adm_cmd dump_md_cmd = {"dump-md", adm_drbdmeta, &dump_md_ctx, ACF1_MINOR_ONLY }; + static struct adm_cmd wipe_md_cmd = {"wipe-md", adm_drbdmeta, ACF1_MINOR_ONLY }; + static struct adm_cmd apply_al_cmd = {"apply-al", adm_drbdmeta, ACF1_MINOR_ONLY }; + static struct adm_cmd forget_peer_cmd = {"forget-peer", adm_forget_peer, ACF1_DISCONNECT }; diff --git a/drbd-utils.changes b/drbd-utils.changes index c8e919f..7308c88 100644 --- a/drbd-utils.changes +++ b/drbd-utils.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Feb 5 07:09:33 UTC 2018 - nwang@suse.com + +- bsc#1077176, pass the string to backend. +- bsc#1058770, fix kernel trace while starting + sync stacked drbd +- Add patch Fix-no-bitmap-allocate-for-stacked-res.patch +- Add patch Support-pass-force-to-dump-md.patch + ------------------------------------------------------------------- Mon Jan 22 05:02:12 UTC 2018 - nwang@suse.com diff --git a/drbd-utils.spec b/drbd-utils.spec index 936c3b4..77e6108 100644 --- a/drbd-utils.spec +++ b/drbd-utils.spec @@ -37,6 +37,8 @@ Patch5: 0001-Disable-quorum-in-default-configuration-bsc-1032142.patch Patch6: fix_call_khelper_with_stack.patch Patch7: move_fencing_from_disk_to_net_in_example.patch Patch8: skip_sh-b-pri_in_v9.patch +Patch9: Fix-no-bitmap-allocate-for-stacked-res.patch +Patch10: Support-pass-force-to-dump-md.patch Provides: drbd-bash-completion = %{version} Provides: drbd-pacemaker = %{version} @@ -87,6 +89,8 @@ raid 1. It is a building block for setting up clusters. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build export WANT_DRBD_REPRODUCIBLE_BUILD=1