drbd/bsc-1201335_02-compat-only-apply-bdi-pointer-patch-if-bdi-is-in-req.patch
Roger Zhou 1eb6b25c2a Accepting request 987977 from home:hmzhao:branches:network:ha-clustering:Factory
- drbd: build error against kernel v5.18 (bsc#1201335)
  - remove patch: move_bdi_from_request_queue_to_gendisk
  - 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-0001-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

OBS-URL: https://build.opensuse.org/request/show/987977
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=137
2022-07-09 00:28:28 +00:00

38 lines
1.4 KiB
Diff

From eacd74206a8f48c3861de2096215790426331237 Mon Sep 17 00:00:00 2001
From: <christoph.boehmwalder@linbit.com>
Date: Wed, 6 Apr 2022 13:36:08 +0200
Subject: [PATCH] compat: only apply bdi pointer patch if bdi is in
request_queue
The history is as follows:
1. In the beginning, request_queue.backing_dev_info was a regular member
2. Then, backing_dev_info became a pointer
3. Now the backing_dev_info pointer has moved to gendisk.bdi
So there is never a case where gendisk has a non-pointer
backing_dev_info. Thus, we only want to apply the pointer patch for old
kernels where backing_dev_info was still in request_queue.
---
drbd/drbd-kernel-compat/gen_patch_names.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drbd/drbd-kernel-compat/gen_patch_names.c b/drbd/drbd-kernel-compat/gen_patch_names.c
index 9210d2c2eeb9..763652a8908b 100644
--- a/drbd/drbd-kernel-compat/gen_patch_names.c
+++ b/drbd/drbd-kernel-compat/gen_patch_names.c
@@ -400,8 +400,10 @@ int main(int argc, char **argv)
patch(1, "struct_gendisk", true, false,
COMPAT_STRUCT_GENDISK_HAS_BACKING_DEV_INFO, "has_backing_dev_info");
+#if !defined(COMPAT_STRUCT_GENDISK_HAS_BACKING_DEV_INFO)
patch(1, "backing_dev_info", true, false,
COMPAT_HAVE_POINTER_BACKING_DEV_INFO, "is_pointer");
+#endif
patch(1, "sendpage_ok", true, false,
COMPAT_HAVE_SENDPAGE_OK, "present");
--
2.34.1