From 8d332a450810dd6abe6571a233537735e17e9c97 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 21 Dec 2022 19:34:13 -0800 Subject: drbd,drbd-utils: Upgrade to 9.2.1 and drbd-utils to 9.22.0 Signed-off-by: Khem Raj --- .../0001-replace-off64_t-with-off_t.patch | 48 +++++++++++ ...p-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch | 96 ++++++++++++++++++++++ .../recipes-support/drbd/drbd-utils_9.20.2.bb | 73 ---------------- .../recipes-support/drbd/drbd-utils_9.22.0.bb | 74 +++++++++++++++++ .../recipes-support/drbd/drbd_9.0.24-1.bb | 24 ------ meta-networking/recipes-support/drbd/drbd_9.2.1.bb | 24 ++++++ 6 files changed, 242 insertions(+), 97 deletions(-) create mode 100644 meta-networking/recipes-support/drbd/drbd-utils/0001-replace-off64_t-with-off_t.patch create mode 100644 meta-networking/recipes-support/drbd/drbd-utils/0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch delete mode 100644 meta-networking/recipes-support/drbd/drbd-utils_9.20.2.bb create mode 100644 meta-networking/recipes-support/drbd/drbd-utils_9.22.0.bb delete mode 100644 meta-networking/recipes-support/drbd/drbd_9.0.24-1.bb create mode 100644 meta-networking/recipes-support/drbd/drbd_9.2.1.bb diff --git a/meta-networking/recipes-support/drbd/drbd-utils/0001-replace-off64_t-with-off_t.patch b/meta-networking/recipes-support/drbd/drbd-utils/0001-replace-off64_t-with-off_t.patch new file mode 100644 index 0000000000..2841d0feaf --- /dev/null +++ b/meta-networking/recipes-support/drbd/drbd-utils/0001-replace-off64_t-with-off_t.patch @@ -0,0 +1,48 @@ +From 5adae6737e919d957a08df437951ccb6996f9882 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 21 Dec 2022 19:16:03 -0800 +Subject: [PATCH 1/2] replace off64_t with off_t + +off_t is already 64-bits when _FILE_OFFSET_BITS=64 +using off_t also makes it portable on musl systems + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + user/v9/drbdadm_main.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/user/v9/drbdadm_main.c b/user/v9/drbdadm_main.c +index 91e9507d..2030946c 100644 +--- a/user/v9/drbdadm_main.c ++++ b/user/v9/drbdadm_main.c +@@ -1264,11 +1264,11 @@ static int adm_resource(const struct cfg_ctx *ctx) + return ex; + } + +-static off64_t read_drbd_dev_size(int minor) ++static off_t read_drbd_dev_size(int minor) + { + char *path; + FILE *file; +- off64_t val; ++ off_t val; + int r; + + m_asprintf(&path, "/sys/block/drbd%d/size", minor); +@@ -1289,9 +1289,9 @@ int adm_resize(const struct cfg_ctx *ctx) + char *argv[MAX_ARGS]; + struct d_option *opt; + bool is_resize = !strcmp(ctx->cmd->name, "resize"); +- off64_t old_size = -1; +- off64_t target_size = 0; +- off64_t new_size; ++ off_t old_size = -1; ++ off_t target_size = 0; ++ off_t new_size; + int argc = 0; + int silent; + int ex; +-- +2.39.0 + diff --git a/meta-networking/recipes-support/drbd/drbd-utils/0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch b/meta-networking/recipes-support/drbd/drbd-utils/0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch new file mode 100644 index 0000000000..45f7d6d415 --- /dev/null +++ b/meta-networking/recipes-support/drbd/drbd-utils/0002-drbdadm-drop-use-of-GLOB_MAGCHAR-use-strchr-heuristi.patch @@ -0,0 +1,96 @@ +From b70e5bf5bfa5fa2c2fffe08bcf300da1d3583602 Mon Sep 17 00:00:00 2001 +From: Lars Ellenberg +Date: Wed, 9 Nov 2022 11:01:54 +0100 +Subject: [PATCH 2/2] drbdadm: drop use of GLOB_MAGCHAR, use strchr heuristic only + +Fixup for +2022-09-05 4a1b5900 drbdadm: allow files from an expanded include glob to vanish + +When using the `include` statement, if the glob did not match any file, +there is nothing to do, silently ignore. Unless it was no glob, but a literal, +which we would expect to exist. + +Also, there is a race between expanding a glob and accessing the file. +That also should not happen for literals, though. + +Since we still had the heuristic anyways, because apparently |GLOB_MAGCHAR +does not happen for GLOB_NOMATCH returns, and there exist non-GNU libc that +don't (and likely won't) implement that extension, just forget about +(gl_flags & GLOB_MAGCHAR) but use the incomplete strchr heuristic only. + +Sourced From Alpine: https://git.alpinelinux.org/aports/tree/main/drbd-utils/drop_use_of_GLOB_MAGCHAR.patch + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + user/v9/drbdadm_parser.c | 35 ++++++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 15 deletions(-) + +diff --git a/user/v9/drbdadm_parser.c b/user/v9/drbdadm_parser.c +index b2f6ed8a..9a0a775d 100644 +--- a/user/v9/drbdadm_parser.c ++++ b/user/v9/drbdadm_parser.c +@@ -1947,14 +1947,29 @@ void include_stmt(char *str) + size_t i; + int r; + +- cwd = pushd_to_current_config_file_unless_stdin(); +- +- /* """ ++ /* ++ * If the glob did not match any file, ++ * there is nothing to do, silently ignore. ++ * Unless it was no glob, but a literal, ++ * which we would expect to exist. ++ * ++ * """ + * As a GNU extension, pglob->gl_flags is set to the + * flags specified, ored with GLOB_MAGCHAR if any + * metacharacters were found. + * """ ++ * ++ * But apparently |GLOB_MAGCHAR does not happen for GLOB_NOMATCH returns, ++ * at least not consistently :-( ++ * Also, there exist non-GNU libc ++ * So we have this incomplete strchr heuristic anyways. + */ ++ bool contains_glob_magic_char = ++ strchr(str, '*') || ++ strchr(str, '?') || ++ strchr(str, '['); ++ ++ cwd = pushd_to_current_config_file_unless_stdin(); + r = glob(str, 0, NULL, &glob_buf); + if (r == 0) { + for (i=0; i