drbd/0026-compat-gate-blkdev_-patches-behind-bdev_open_by_path.patch
heming zhao bd99eea891 - drbdadm down fails to remove sysfs holder file (boo#1230635)
* add patch
    + boo1230635_01-compat-fix-nla_nest_start_noflag-test.patch
    + boo1230635_02-drbd-port-block-device-access-to-file.patch
  * update patch
    + bsc1226510-fix-build-err-against-6.9.3.patch

OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=152
2024-09-17 11:55:19 +00:00

42 lines
1.5 KiB
Diff

From 6088f29b44fed60d1e631383a9b6f280ff42aaa6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20B=C3=B6hmwalder?=
<christoph.boehmwalder@linbit.com>
Date: Thu, 11 Apr 2024 11:59:38 +0200
Subject: [PATCH 3/3] compat: gate blkdev_* patches behind bdev_open_by_path
If we have bdev_open_by_path, there is no need to consider these patches
since they only apply to the (older) blkdev_{get_put}_* functions.
---
drbd/drbd-kernel-compat/gen_patch_names.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c
index d6fe75a80cf6..8355e723f82c 100644
--- a/drbd/drbd-kernel-compat/gen_patch_names.c
+++ b/drbd/drbd-kernel-compat/gen_patch_names.c
@@ -562,8 +562,10 @@ int main(int argc, char **argv)
patch(1, "bdev_open_by_path", true, false,
COMPAT_HAVE_BDEV_OPEN_BY_PATH, "present");
+#if !defined(COMPAT_HAVE_BDEV_OPEN_BY_PATH)
patch(1, "blkdev_get_by_path", true, false,
COMPAT_BLKDEV_GET_BY_PATH_HAS_HOLDER_OPS, "has_holder_ops");
+#endif
patch(1, "block_device_operations_open", true, false,
COMPAT_BLOCK_DEVICE_OPERATIONS_OPEN_TAKES_GENDISK, "takes_gendisk");
@@ -574,8 +576,10 @@ int main(int argc, char **argv)
patch(1, "blk_mode_t", true, false,
COMPAT_HAVE_BLK_MODE_T, "present");
+#if !defined(COMPAT_HAVE_BDEV_OPEN_BY_PATH)
patch(1, "blkdev_put", true, false,
COMPAT_BLKDEV_PUT_HAS_HOLDER, "has_holder");
+#endif
patch(1, "genl_info_userhdr", true, false,
COMPAT_HAVE_GENL_INFO_USERHDR, "present");
--
2.44.0