Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package drbd for openSUSE:Factory checked in 
at 2022-07-18 18:34:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/drbd (Old)
 and      /work/SRC/openSUSE:Factory/.drbd.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "drbd"

Mon Jul 18 18:34:27 2022 rev:97 rq:989813 version:9.0.30~1+git.8e9c0812

Changes:
--------
--- /work/SRC/openSUSE:Factory/drbd/drbd.changes        2021-11-22 
23:04:47.153810864 +0100
+++ /work/SRC/openSUSE:Factory/.drbd.new.1523/drbd.changes      2022-07-18 
18:34:42.953823921 +0200
@@ -1,0 +2,35 @@
+Fri Jul 08 12:47:00 UTC 2022 - Heming Zhao <heming.z...@suse.com>
+
+- 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
+
+-------------------------------------------------------------------

Old:
----
  add_disk_error_handle.patch
  dax_support.patch
  have_void_drbd_submit_bio.patch
  make_block_holder_optional.patch
  move_bdi_from_request_queue_to_gendisk.patch
  move_kvmalloc_related_to_slab.patch
  pass_gend_to_blk_queue_update_readahead.patch
  polling_to_bio_base.patch
  remove_bdgrab.patch

New:
----
  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
  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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ drbd.spec ++++++
--- /var/tmp/diff_new_pack.TOfPwK/_old  2022-07-18 18:34:43.981825383 +0200
+++ /var/tmp/diff_new_pack.TOfPwK/_new  2022-07-18 18:34:43.985825388 +0200
@@ -35,15 +35,23 @@
 Source2:        Module.supported
 Source3:        drbd_git_revision
 Patch1:         fix-resync-finished-with-syncs-have-bits-set.patch
-Patch2:         make_block_holder_optional.patch
-Patch3:         move_kvmalloc_related_to_slab.patch
-Patch4:         polling_to_bio_base.patch
-Patch5:         pass_gend_to_blk_queue_update_readahead.patch
-Patch6:         move_bdi_from_request_queue_to_gendisk.patch
-Patch7:         dax_support.patch
-Patch8:         add_disk_error_handle.patch
-Patch9:         have_void_drbd_submit_bio.patch
-Patch10:        remove_bdgrab.patch
+Patch2:         bsc-1192929_01-make_block_holder_optional.patch
+Patch3:         bsc-1192929_02-move_kvmalloc_related_to_slab.patch
+Patch4:         bsc-1192929_03-polling_to_bio_base.patch
+Patch5:         bsc-1192929_04-pass_gend_to_blk_queue_update_readahead.patch
+#Patch6:         bsc-1192929_05-move_bdi_from_request_queue_to_gendisk
+Patch7:         bsc-1192929_06-dax_support.patch
+Patch8:         bsc-1192929_07-add_disk_error_handle.patch
+Patch9:         bsc-1192929_08-have_void_drbd_submit_bio.patch
+Patch10:        bsc-1192929_09-remove_bdgrab.patch
+Patch11:        
bsc-1201335_01-compat-test-and-cocci-patch-for-bdi-in-gendisk.patch
+Patch12:        
bsc-1201335_02-compat-only-apply-bdi-pointer-patch-if-bdi-is-in-req.patch
+Patch13:        bsc-1201335_03-genhd.patch
+Patch14:        bsc-1201335_04-bio_alloc_bioset.patch
+Patch15:        bsc-1201335_05-bio_alloc.patch
+Patch16:        bsc-1201335_06-bdi.patch
+Patch17:        bsc-1201335_07-write-same.patch
+Patch18:        bsc-1201335_08-bio_clone_fast.patch
 Patch99:        suse-coccinelle.patch
 #https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py
 BuildRequires:  coccinelle >= 1.0.8
@@ -82,11 +90,19 @@
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
-%patch6 -p1
+#%patch6 -p1
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
 %patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
 %patch99 -p1
 
 mkdir source

++++++ bsc-1192929_01-make_block_holder_optional.patch ++++++
/* {"version":"v5.15-rc1~161", "commit": 
"c66fd019713e9cf7d6f1243c378cd177d01fe18a", "comment": "block: make the block 
holder code optional"} */

diff -Naur 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_bd_claim_by_disk.c
 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_bd_claim_by_disk.c
--- 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_bd_claim_by_disk.c
       2021-11-18 11:27:38.503118180 +0800
+++ 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_bd_claim_by_disk.c
    2021-11-18 11:28:30.370889421 +0800
@@ -1,6 +1,6 @@
 #include <linux/fs.h>
 
-#ifdef CONFIG_SYSFS
+#if defined(CONFIG_SYSFS) || defined(CONFIG_BLOCK_HOLDER_DEPRECATED)
 void dummy(struct block_device *bdev, void *holder, struct gendisk *disk)
 {
        bd_claim_by_disk(bdev, holder, disk);
diff -Naur 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c
 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c
--- 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c
  2021-11-18 11:27:38.503118180 +0800
+++ 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c
       2021-11-18 13:15:26.943553840 +0800
@@ -2,12 +2,12 @@
 #include <linux/fs.h>
 #include <linux/blkdev.h>
 
-#ifdef CONFIG_SYSFS
+#if defined(CONFIG_SYSFS) || defined(CONFIG_BLOCK_HOLDER_DEPRECATED)
 void dummy(struct block_device *bdev, struct gendisk *disk)
 {
        /* also check that we are not between 49731ba and e09b457,
         * where there was a singular bd_holder_disk for a short time */
-       if (!list_empty(&bdev->bd_holder_disks))
+       /* if (!list_empty(&bdev->bd_holder_disks)) */
                bd_unlink_disk_holder(bdev, disk);
 }
 #endif

++++++ bsc-1192929_02-move_kvmalloc_related_to_slab.patch ++++++
/* {"version":"v5.16-rc1~106", "commit": 
"8587ca6f34152ea650bad4b2db68456601159024", "comment": "mm: move 
kvmalloc-related functions to slab.h"} */

diff -Naur 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_kvfree.c 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_kvfree.c
--- drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_kvfree.c      
2021-11-09 22:43:17.000000000 +0800
+++ drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_kvfree.c 
2021-11-18 13:32:39.783138887 +0800
@@ -1,4 +1,5 @@
 #include <linux/mm.h>
+#include <linux/slab.h>
 
 void foo(void) {
        kvfree(NULL);

++++++ bsc-1192929_03-polling_to_bio_base.patch ++++++
/* {"version":"v5.16-rc1~75", "commit": 
"3e08773c3841e9db7a520908cc2b136a77d275ff", "comment": "block: switch polling 
to be bio based"} */

diff -Naur 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_submit_bio_noacct.c
 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_submit_bio_noacct.c
--- 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_submit_bio_noacct.c
      2021-11-18 13:33:44.434862535 +0800
+++ 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_submit_bio_noacct.c
   2021-11-18 16:47:31.764019596 +0800
@@ -4,7 +4,5 @@
 
 void foo(struct bio *bio)
 {
-       blk_qc_t result;
-
-       result = submit_bio_noacct(bio);
+       submit_bio_noacct(bio);
 }

++++++ bsc-1192929_04-pass_gend_to_blk_queue_update_readahead.patch ++++++
/* {"version":"v5.15-rc1~161", "commit": 
""471aa704db4904f7af5a50019ca3b5b018c0cf62, "comment": "block: pass a gendisk 
to blk_queue_update_readahead"} */

diff -Naur 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/gen_patch_names.c 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/gen_patch_names.c
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/gen_patch_names.c   
2021-11-19 12:56:56.962529304 +0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/gen_patch_names.c        
2021-11-19 12:58:45.370112678 +0800
@@ -391,8 +391,10 @@
        patch(1, "wb_congested_enum", true, false,
              COMPAT_HAVE_WB_CONGESTED_ENUM, "present");
 
+#ifndef COMPAT_HAVE_DISK_UPDATE_READAHEAD
        patch(1, "blk_queue_update_readahead", true, false,
              COMPAT_HAVE_BLK_QUEUE_UPDATE_READAHEAD, "present");
+#endif
 
        patch(1, "backing_dev_info", true, false,
              COMPAT_HAVE_POINTER_BACKING_DEV_INFO, "is_pointer");
diff -Naur 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_disk_update_readahead.c
 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_disk_update_readahead.c
--- 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_disk_update_readahead.c
  1970-01-01 08:00:00.000000000 +0800
+++ 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_disk_update_readahead.c
       2021-11-19 12:59:10.194017276 +0800
@@ -0,0 +1,9 @@
+/* { "version": "v5.16", "commit": "471aa704db4904f7af5a50019ca3b5b018c0cf62", 
"comment": "block: pass a gendisk to blk_queue_update_readahead", "author": 
"Christoph Hellwig <h...@lst.de>", "date": "Mon Aug 9 16:17:41 2021 +0200" } */
+
+#include <linux/genhd.h>
+#include <linux/blkdev.h>
+
+void foo(struct gendisk *d)
+{
+       disk_update_readahead(d);
+}
diff -Naur drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_nl.c 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd_nl.c
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_nl.c      2021-11-19 
12:56:56.966529288 +0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_nl.c   2021-11-19 13:00:37.777680684 
+0800
@@ -2124,7 +2124,11 @@
 
        if (b) {
                blk_stack_limits(&q->limits, &b->limits, 0);
+#ifdef COMPAT_HAVE_DISK_UPDATE_READAHEAD
+               disk_update_readahead(device->vdisk);
+#else
                blk_queue_update_readahead(q);
+#endif
        }
        fixup_discard_if_not_supported(q);
        fixup_write_zeroes(device, q);

++++++ bsc-1192929_06-dax_support.patch ++++++
/* {"version":"v5.15-rc1~45", "commit": 
"1b7646014e0d838b06be7288e2dec3262948cc56", "comment": "dax: mark 
dax_get_by_host static"} */

diff -Naru drbd-9.0.30~1+git.8e9c0812.orig/drbd/Kbuild 
drbd-9.0.30~1+git.8e9c0812/drbd/Kbuild
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/Kbuild 2021-11-22 10:12:32.660034839 
+0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/Kbuild      2021-11-22 10:15:26.327117285 
+0800
@@ -53,6 +53,11 @@
 endif
 endif
 
+ifeq ($(shell grep -e '\<dax_get_by_host\>' \
+                  $(objtree)/Module.symvers | wc -l),1)
+override EXTRA_CFLAGS += -DDAX_GET_BY_HOST_EXPORTED
+endif
+
 drbd-$(CONFIG_DEBUG_FS) += drbd_debugfs.o
 drbd-y += drbd_buildtag.o drbd_bitmap.o drbd_proc.o
 drbd-y += drbd_sender.o drbd_receiver.o drbd_req.o drbd_actlog.o
diff -Naru drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_dax_pmem.c 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd_dax_pmem.c
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_dax_pmem.c        2021-11-22 
10:12:32.668034796 +0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_dax_pmem.c     2021-11-22 
10:32:04.933864379 +0800
@@ -29,6 +29,53 @@
 #include "drbd_dax_pmem.h"
 #include "drbd_meta_data.h"
 
+#ifndef DAX_GET_BY_HOST_EXPORTED
+/* From drivers/dax/super.c */
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/radix-tree.h>
+
+#define DAX_HASH_SIZE (PAGE_SIZE / sizeof(struct hlist_head))
+static DEFINE_SPINLOCK(dax_host_lock);
+static struct hlist_head dax_host_list[DAX_HASH_SIZE];
+
+static int dax_host_hash(const char *host)
+{
+       return hashlen_hash(hashlen_string("DAX", host)) % DAX_HASH_SIZE;
+}
+
+/**
+ * dax_get_by_host() - temporary lookup mechanism for filesystem-dax
+ * @host: alternate name for the device registered by a dax driver
+ */
+struct dax_device *dax_get_by_host(const char *host)
+{
+       struct dax_device *dax_dev, *found = NULL;
+       int hash, id;
+
+       if (!host)
+               return NULL;
+
+       hash = dax_host_hash(host);
+
+       id = dax_read_lock();
+       spin_lock(&dax_host_lock);
+       hlist_for_each_entry(dax_dev, &dax_host_list[hash], list) {
+               if (!dax_alive(dax_dev)
+                               || strcmp(host, dax_dev->host) != 0)
+                       continue;
+
+               if (igrab(&dax_dev->inode))
+                       found = dax_dev;
+               break;
+       }
+       spin_unlock(&dax_host_lock);
+       dax_read_unlock(id);
+
+       return found;
+}
+#endif
+
 static int map_superblock_for_dax(struct drbd_backing_dev *bdev, struct 
dax_device *dax_dev)
 {
        long want = 1;
diff -Naru drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_dax_pmem.h 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd_dax_pmem.h
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_dax_pmem.h        2021-11-22 
10:12:32.668034796 +0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_dax_pmem.h     2021-11-22 
10:32:22.449772726 +0800
@@ -36,4 +36,29 @@
 
 #endif /* IS_ENABLED(CONFIG_DEV_DAX_PMEM) */
 
+#ifndef DAX_GET_BY_HOST_EXPORTED
+#include <linux/cdev.h>
+/**
+ * struct dax_device - anchor object for dax services
+ * @inode: core vfs
+ * @cdev: optional character interface for "device dax"
+ * @host: optional name for lookups where the device path is not available
+ * @private: dax driver private data
+ * @flags: state and boolean properties
+ */
+struct dax_device {
+       struct hlist_node list;
+       struct inode inode;
+       struct cdev cdev;
+       const char *host;
+       void *private;
+       unsigned long flags;
+       const struct dax_operations *ops;
+};
+
+#define DAX_HASH_SIZE (PAGE_SIZE / sizeof(struct hlist_head))
+
+extern struct dax_device *dax_get_by_host(const char *);
+#endif
+
 #endif /* DRBD_DAX_H */

++++++ bsc-1192929_07-add_disk_error_handle.patch ++++++
/* {"version":"v5.16-rc1~73", "commit": 
"e92ab4eda516a5bfd96c087282ebe9521deba4f4", "comment": "drbd: add error 
handling support for add_disk()"} */

diff -Naur drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_main.c 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd_main.c
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_main.c    2021-11-19 
15:36:33.405592808 +0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_main.c 2021-11-19 15:43:32.799929686 
+0800
@@ -3794,7 +3794,10 @@
                goto out_remove_peer_device;
        }
 
-       add_disk(disk);
+       err = add_disk(disk);
+       if (err)
+               goto out_cleanup_disk;
+
        device->have_quorum[OLD] =
        device->have_quorum[NEW] =
                (resource->res_opts.quorum == QOU_OFF);
@@ -3811,6 +3814,8 @@
        *p_device = device;
        return NO_ERROR;
 
+out_cleanup_disk:
+       blk_cleanup_disk(disk);
 out_remove_peer_device:
        list_add_rcu(&tmp, &device->peer_devices);
        list_del_init(&device->peer_devices);

++++++ bsc-1192929_08-have_void_drbd_submit_bio.patch ++++++
/* {"version":"v5.16-rc1~75", "commit": 
"3e08773c3841e9db7a520908cc2b136a77d275ff", "comment": "block: switch polling 
to be bio based"} */

diff -Naur 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_void_drbd_submit_bio.c
 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_void_drbd_submit_bio.c
--- 
drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_void_drbd_submit_bio.c
   1970-01-01 08:00:00.000000000 +0800
+++ 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_void_drbd_submit_bio.c
        2021-11-19 16:52:39.349253992 +0800
@@ -0,0 +1,8 @@
+/* { "version": "v5.16-rc1", "commit": 
"3e08773c3841e9db7a520908cc2b136a77d275ff", "comment": "block: switch polling 
to be bio based", "author": "Christoph Hellwig <h...@lst.de>", "date": "Tue Oct 
12 13:12:24 2021 +0200" } */
+
+#include <linux/bio.h>
+
+void foo(struct bio *b)
+{
+       b->bi_cookie = 0;
+}
diff -Naur drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_int.h 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd_int.h
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_int.h     2021-11-19 
16:43:47.011257061 +0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_int.h  2021-11-19 16:57:32.204153502 
+0800
@@ -1848,7 +1848,11 @@
 #define __drbd_make_request(d,b,k,j) __drbd_make_request(d,b,j)
 #endif
 extern void __drbd_make_request(struct drbd_device *, struct bio *, ktime_t, 
unsigned long);
+#ifdef COMPAT_HAVE_VOID_DRBD_SUBMIT_BIO
+extern void drbd_submit_bio(struct bio *bio);
+#else
 extern blk_qc_t drbd_submit_bio(struct bio *bio);
+#endif
 
 /* drbd_nl.c */
 enum suspend_scope {
diff -Naur drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_req.c 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd_req.c
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_req.c     2021-11-19 
16:43:47.011257061 +0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_req.c  2021-11-19 16:54:34.460820836 
+0800
@@ -2186,7 +2186,11 @@
        return false;
 }
 
+#ifdef COMPAT_HAVE_VOID_DRBD_SUBMIT_BIO
+void drbd_submit_bio(struct bio *bio)
+#else
 blk_qc_t drbd_submit_bio(struct bio *bio)
+#endif
 {
        struct drbd_device *device = bio->bi_bdev->bd_disk->private_data;
 #ifdef CONFIG_DRBD_TIMING_STATS
@@ -2197,7 +2201,9 @@
        if (drbd_fail_request_early(device, bio)) {
                bio->bi_status = BLK_STS_IOERR;
                bio_endio(bio);
+#ifndef COMPAT_HAVE_VOID_DRBD_SUBMIT_BIO
                return BLK_QC_T_NONE;
+#endif
        }
 
        blk_queue_split(&bio);
@@ -2205,7 +2211,9 @@
        if (device->cached_err_io) {
                bio->bi_status = BLK_STS_IOERR;
                bio_endio(bio);
+#ifndef COMPAT_HAVE_VOID_DRBD_SUBMIT_BIO
                return BLK_QC_T_NONE;
+#endif
        }
 
        /* This is both an optimization: READ of size 0, nothing to do
@@ -2217,7 +2225,9 @@
        if (bio_op(bio) == REQ_OP_READ && bio->bi_iter.bi_size == 0) {
                WARN_ONCE(1, "size zero read from upper layers");
                bio_endio(bio);
+#ifndef COMPAT_HAVE_VOID_DRBD_SUBMIT_BIO
                return BLK_QC_T_NONE;
+#endif
        }
 
        ktime_get_accounting(start_kt);
@@ -2225,7 +2235,9 @@
 
        __drbd_make_request(device, bio, start_kt, start_jif);
 
+#ifndef COMPAT_HAVE_VOID_DRBD_SUBMIT_BIO
        return BLK_QC_T_NONE;
+#endif
 }
 
 static unsigned long time_min_in_future(unsigned long now,

++++++ bsc-1192929_09-remove_bdgrab.patch ++++++
/* {"version":"v5.15-rc1~161", "commit": 
"14cf1dbb55bb07427babee425fd2a8a9300737cc", "comment": "block: remove bdgrab"} 
*/

diff -Naur drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_nl.c 
drbd-9.0.30~1+git.8e9c0812/drbd/drbd_nl.c
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_nl.c      2021-11-22 
12:32:17.202848720 +0800
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_nl.c   2021-11-22 12:32:57.719098447 
+0800
@@ -1038,10 +1038,7 @@
        } else /* (role == R_SECONDARY) */ {
                down(&resource->state_sem);
                idr_for_each_entry(&resource->devices, device, vnr) {
-                       bdev = bdgrab(device->vdisk->part0);
-                       if (bdev)
-                               fsync_bdev(bdev);
-                       bdput(bdev);
+                       fsync_bdev(bdev);
                        flush_workqueue(device->submit.wq);
                }
 

++++++ bsc-1201335_01-compat-test-and-cocci-patch-for-bdi-in-gendisk.patch 
++++++
>From 25592a4a902415cf1a353a1e26ba11b4ccc0eca7 Mon Sep 17 00:00:00 2001
From: <christoph.boehmwal...@linbit.com>
Date: Wed, 6 Apr 2022 12:27:36 +0200
Subject: [PATCH] compat: test and cocci patch for bdi in gendisk

---
 .../cocci/struct_gendisk__no_has_backing_dev_info.cocci   | 6 ++++++
 drbd/drbd-kernel-compat/gen_patch_names.c                 | 3 +++
 .../tests/struct_gendisk_has_backing_dev_info.c           | 8 ++++++++
 3 files changed, 17 insertions(+)
 create mode 100644 
drbd/drbd-kernel-compat/cocci/struct_gendisk__no_has_backing_dev_info.cocci
 create mode 100644 
drbd/drbd-kernel-compat/tests/struct_gendisk_has_backing_dev_info.c

diff --git 
a/drbd/drbd-kernel-compat/cocci/struct_gendisk__no_has_backing_dev_info.cocci 
b/drbd/drbd-kernel-compat/cocci/struct_gendisk__no_has_backing_dev_info.cocci
new file mode 100644
index 000000000000..b3d290710ee8
--- /dev/null
+++ 
b/drbd/drbd-kernel-compat/cocci/struct_gendisk__no_has_backing_dev_info.cocci
@@ -0,0 +1,6 @@
+@@
+struct drbd_device *d;
+@@
+d->ldev->backing_bdev->
+- bd_disk->bdi
++ bd_disk->queue->backing_dev_info
diff -Nupr a/drbd/drbd-kernel-compat/gen_patch_names.c 
b/drbd/drbd-kernel-compat/gen_patch_names.c
--- a/drbd/drbd-kernel-compat/gen_patch_names.c 2022-07-08 19:43:37.106735503 
+0800
+++ b/drbd/drbd-kernel-compat/gen_patch_names.c 2022-07-08 19:45:17.570310319 
+0800
@@ -396,6 +396,9 @@ int main(int argc, char **argv)
              COMPAT_HAVE_BLK_QUEUE_UPDATE_READAHEAD, "present");
 #endif
 
+       patch(1, "struct_gendisk", true, false,
+             COMPAT_STRUCT_GENDISK_HAS_BACKING_DEV_INFO, 
"has_backing_dev_info");
+
        patch(1, "backing_dev_info", true, false,
              COMPAT_HAVE_POINTER_BACKING_DEV_INFO, "is_pointer");
 
diff --git 
a/drbd/drbd-kernel-compat/tests/struct_gendisk_has_backing_dev_info.c 
b/drbd/drbd-kernel-compat/tests/struct_gendisk_has_backing_dev_info.c
new file mode 100644
index 000000000000..cd40214a564c
--- /dev/null
+++ b/drbd/drbd-kernel-compat/tests/struct_gendisk_has_backing_dev_info.c
@@ -0,0 +1,8 @@
+/* { "version": "v5.15-rc1", "commit": 
"21cf866145047f8bfecb38ec8d2fed64464c074f", "comment": "The backing_dev_info 
was moved from request_queue to backing_dev_info", "author": "Christoph Hellwig 
<h...@lst.de>", "date": "Wed Jul 1 11:06:22 2020 +0200" } */
+
+#include <linux/blkdev.h>
+
+struct backing_dev_info *foo(struct gendisk *d)
+{
+       return d->bdi;
+}
-- 
2.34.1


++++++ 
bsc-1201335_02-compat-only-apply-bdi-pointer-patch-if-bdi-is-in-req.patch ++++++
>From eacd74206a8f48c3861de2096215790426331237 Mon Sep 17 00:00:00 2001
From: <christoph.boehmwal...@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


++++++ bsc-1201335_03-genhd.patch ++++++
/* this patch is related with following upstream kernel commit */

commit 322cbb50de711814c42fb088f6d31901502c711a
Author: Christoph Hellwig <h...@lst.de>
Date:   Mon Jan 24 10:39:13 2022 +0100

    block: remove genhd.h
    
    There is no good reason to keep genhd.h separate from the main blkdev.h
    header that includes it.  So fold the contents of genhd.h into blkdev.h
    and remove genhd.h entirely.

    Signed-off-by: Christoph Hellwig <h...@lst.de>
    Reviewed-by: Chaitanya Kulkarni <k...@nvidia.com>
    Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com>
    Link: https://lore.kernel.org/r/20220124093913.742411-4-...@lst.de
    Signed-off-by: Jens Axboe <ax...@kernel.dk>
---

diff -Nupr a/drbd/drbd-kernel-compat/tests/have_atomic_in_flight.c 
b/drbd/drbd-kernel-compat/tests/have_atomic_in_flight.c
--- a/drbd/drbd-kernel-compat/tests/have_atomic_in_flight.c     2022-07-07 
16:50:27.736823224 +0800
+++ b/drbd/drbd-kernel-compat/tests/have_atomic_in_flight.c     2022-07-08 
18:27:01.362626866 +0800
@@ -1,6 +1,6 @@
 #include <linux/version.h>
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
-#include <linux/genhd.h>
+#include <linux/blkdev.h>
 
 #ifndef __same_type
 # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
diff -Nupr a/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c 
b/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c
--- a/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c        
2022-07-07 16:50:35.476788526 +0800
+++ b/drbd/drbd-kernel-compat/tests/have_bd_unlink_disk_holder.c        
2022-07-07 16:52:09.432367225 +0800
@@ -1,4 +1,3 @@
-#include <linux/genhd.h>
 #include <linux/fs.h>
 #include <linux/blkdev.h>
 
diff -Nupr a/drbd/drbd-kernel-compat/tests/have_blk_alloc_disk.c 
b/drbd/drbd-kernel-compat/tests/have_blk_alloc_disk.c
--- a/drbd/drbd-kernel-compat/tests/have_blk_alloc_disk.c       2022-07-07 
16:50:42.400757477 +0800
+++ b/drbd/drbd-kernel-compat/tests/have_blk_alloc_disk.c       2022-07-08 
18:27:51.914415515 +0800
@@ -1,6 +1,6 @@
 /* { "version": "v5.13-rc4", "commit": 
"b647ad024841d02d67e78716f51f355d8d3e9656", "comment": "5.13 introduces a 
blk_alloc_disk helper", "author": "Christoph Hellwig <h...@lst.de>", "date": 
"Fri May 21 07:50:57 2021 +0200" } */
 
-#include <linux/genhd.h>
+#include <linux/blkdev.h>
 
 struct gendisk *foo(int node)
 {
diff -Nupr a/drbd/drbd-kernel-compat/tests/have_disk_update_readahead.c 
b/drbd/drbd-kernel-compat/tests/have_disk_update_readahead.c
--- a/drbd/drbd-kernel-compat/tests/have_disk_update_readahead.c        
2022-07-08 20:00:47.590378757 +0800
+++ b/drbd/drbd-kernel-compat/tests/have_disk_update_readahead.c        
2022-07-08 20:01:47.462126256 +0800
@@ -1,6 +1,5 @@
 /* { "version": "v5.16", "commit": "471aa704db4904f7af5a50019ca3b5b018c0cf62", 
"comment": "block: pass a gendisk to blk_queue_update_readahead", "author": 
"Christoph Hellwig <h...@lst.de>", "date": "Mon Aug 9 16:17:41 2021 +0200" } */
 
-#include <linux/genhd.h>
 #include <linux/blkdev.h>
 
 void foo(struct gendisk *d)
diff -Nupr a/drbd/drbd-kernel-compat/tests/have_hd_struct.c 
b/drbd/drbd-kernel-compat/tests/have_hd_struct.c
--- a/drbd/drbd-kernel-compat/tests/have_hd_struct.c    2022-07-07 
16:51:01.344672526 +0800
+++ b/drbd/drbd-kernel-compat/tests/have_hd_struct.c    2022-07-08 
18:31:19.633543494 +0800
@@ -1,5 +1,6 @@
 /* { "version": "v5.10-rc5", "commit": 
"0d02129e76edf91cf04fabf1efbc3a9a1f1d729a", "comment": "struct hd_struct was 
merged into struct block_device", "author": "Christoph Hellwig <h...@lst.de>", 
"date": "Fri Nov 27 16:43:51 2020 +0100" } */
 
 #include <linux/genhd.h>
+#include <linux/blkdev.h>
 
 struct hd_struct hd;
diff -Nupr a/drbd/drbd-kernel-compat/tests/have_revalidate_disk_size.c 
b/drbd/drbd-kernel-compat/tests/have_revalidate_disk_size.c
--- a/drbd/drbd-kernel-compat/tests/have_revalidate_disk_size.c 2022-07-07 
16:51:06.892647651 +0800
+++ b/drbd/drbd-kernel-compat/tests/have_revalidate_disk_size.c 2022-07-08 
18:28:55.114151284 +0800
@@ -1,6 +1,6 @@
 /* { "version": "v5.9-rc4", "commit": 
"659e56ba864d37b7ee0a49cd432205b2a5ca815e", "comment": "The 
revalidate_disk_size helper was added in v5.9-rc4", "author": "Christoph 
Hellwig <h...@lst.de>", "date": "Tue Sep 1 17:57:43 2020 +0200" } */
 
-#include <linux/genhd.h>
+#include <linux/blkdev.h>
 
 void foo(struct gendisk *disk)
 {
diff -Nupr a/drbd/drbd-kernel-compat/tests/have_set_capacity_and_notify.c 
b/drbd/drbd-kernel-compat/tests/have_set_capacity_and_notify.c
--- a/drbd/drbd-kernel-compat/tests/have_set_capacity_and_notify.c      
2022-07-07 16:51:12.376623066 +0800
+++ b/drbd/drbd-kernel-compat/tests/have_set_capacity_and_notify.c      
2022-07-08 18:29:26.082021496 +0800
@@ -1,6 +1,6 @@
 /* { "version": "v5.10-rc5", "commit": 
"449f4ec9892ebc2f37a7eae6d97db2cf7c65e09a", "comment": "New (as far as DRBD is 
concerned) helper set_capacity_and_notify", "author": "Christoph Hellwig 
<h...@lst.de>", "date": "Mon Nov 16 15:56:56 2020 +0100" } */
 
-#include <linux/genhd.h>
+#include <linux/blkdev.h>
 
 bool foo(struct gendisk *disk, sector_t size)
 {
diff -Nupr a/drbd/drbd_int.h b/drbd/drbd_int.h
--- a/drbd/drbd_int.h   2022-07-07 16:50:13.032889154 +0800
+++ b/drbd/drbd_int.h   2022-07-07 16:51:38.292506862 +0800
@@ -28,7 +28,6 @@
 #include <linux/major.h>
 #include <linux/blkdev.h>
 #include <linux/backing-dev.h>
-#include <linux/genhd.h>
 #include <linux/idr.h>
 #include <linux/lru_cache.h>
 #include <linux/prefetch.h>

++++++ bsc-1201335_04-bio_alloc_bioset.patch ++++++
/* This patch is related with following upstream kernel commit */

commit 609be1066731fea86436f5f91022f82e592ab456
Author: Christoph Hellwig <h...@lst.de>
Date:   Mon Jan 24 10:11:03 2022 +0100

    block: pass a block_device and opf to bio_alloc_bioset
    
    Pass the block_device and operation that we plan to use this bio for to
    bio_alloc_bioset to optimize the assigment.  NULL/0 can be passed, both
    for the passthrough case on a raw request_queue and to temporarily avoid
    refactoring some nasty code.
    
    Also move the gfp_mask argument after the nr_vecs argument for a much
    more logical calling convention matching what most of the kernel does.
    
    Signed-off-by: Christoph Hellwig <h...@lst.de>
    Reviewed-by: Chaitanya Kulkarni <k...@nvidia.com>
    Link: https://lore.kernel.org/r/20220124091107.642561-16-...@lst.de
    Signed-off-by: Jens Axboe <ax...@kernel.dk>
---

diff -Nupr a/drbd/drbd_actlog.c b/drbd/drbd_actlog.c
--- a/drbd/drbd_actlog.c        2022-07-07 18:23:47.643895879 +0800
+++ b/drbd/drbd_actlog.c        2022-07-08 06:46:56.597471149 +0800
@@ -94,8 +94,8 @@ static int _drbd_md_sync_page_io(struct
        device->md_io.done = 0;
        device->md_io.error = -ENODEV;
 
-       bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
-       bio_set_dev(bio, bdev->md_bdev);
+       bio = bio_alloc_bioset(bdev->md_bdev, 1, op | op_flags, GFP_NOIO,
+                              &drbd_md_io_bio_set);
        bio->bi_iter.bi_sector = sector;
        err = -EIO;
        if (bio_add_page(bio, device->md_io.page, size, 0) != size)
@@ -103,8 +103,6 @@ static int _drbd_md_sync_page_io(struct
        bio->bi_private = device;
        bio->bi_end_io = drbd_md_endio;
 
-       bio->bi_opf = op | op_flags;
-
        if (op != REQ_OP_WRITE && device->disk_state[NOW] == D_DISKLESS && 
device->ldev == NULL)
                /* special case, drbd_md_read() during drbd_adm_attach(): no 
get_ldev */
                ;
diff -Nupr a/drbd/drbd_bitmap.c b/drbd/drbd_bitmap.c
--- a/drbd/drbd_bitmap.c        2022-07-07 18:24:13.671780513 +0800
+++ b/drbd/drbd_bitmap.c        2022-07-08 06:49:05.232970673 +0800
@@ -1123,12 +1123,13 @@ static void drbd_bm_endio(struct bio *bi
 
 static void bm_page_io_async(struct drbd_bm_aio_ctx *ctx, int page_nr) 
__must_hold(local)
 {
-       struct bio *bio = bio_alloc_bioset(GFP_NOIO, 1, &drbd_md_io_bio_set);
        struct drbd_device *device = ctx->device;
+       unsigned int op = (ctx->flags & BM_AIO_READ) ? REQ_OP_READ : 
REQ_OP_WRITE;
+       struct bio *bio = bio_alloc_bioset(device->ldev->md_bdev, 1, op,
+                                          GFP_NOIO, &drbd_md_io_bio_set);
        struct drbd_bitmap *b = device->bitmap;
        struct page *page;
        unsigned int len;
-       unsigned int op = (ctx->flags & BM_AIO_READ) ? REQ_OP_READ : 
REQ_OP_WRITE;
 
        sector_t on_disk_sector =
                device->ldev->md.md_offset + device->ldev->md.bm_offset;
@@ -1153,14 +1154,12 @@ static void bm_page_io_async(struct drbd
                bm_store_page_idx(page, page_nr);
        } else
                page = b->bm_pages[page_nr];
-       bio_set_dev(bio, device->ldev->md_bdev);
        bio->bi_iter.bi_sector = on_disk_sector;
        /* bio_add_page of a single page to an empty bio will always succeed,
         * according to api.  Do we want to assert that? */
        bio_add_page(bio, page, len, 0);
        bio->bi_private = ctx;
        bio->bi_end_io = drbd_bm_endio;
-       bio->bi_opf = op;
 
        if (drbd_insert_fault(device, (op == REQ_OP_WRITE) ? DRBD_FAULT_MD_WR : 
DRBD_FAULT_MD_RD)) {
                bio->bi_status = BLK_STS_IOERR;

++++++ bsc-1201335_05-bio_alloc.patch ++++++
/* this patch is related with following upstream kernel commit */

commit 07888c665b405b1cd3577ddebfeb74f4717a84c4
Author: Christoph Hellwig <h...@lst.de>
Date:   Mon Jan 24 10:11:05 2022 +0100

    block: pass a block_device and opf to bio_alloc
    
    Pass the block_device and operation that we plan to use this bio for to
    bio_alloc to optimize the assignment.  NULL/0 can be passed, both for the
    passthrough case on a raw request_queue and to temporarily avoid
    refactoring some nasty code.
    
    Also move the gfp_mask argument after the nr_vecs argument for a much
    more logical calling convention matching what most of the kernel does.
    
    Signed-off-by: Christoph Hellwig <h...@lst.de>
    Reviewed-by: Chaitanya Kulkarni <k...@nvidia.com>
    Link: https://lore.kernel.org/r/20220124091107.642561-18-...@lst.de
    Signed-off-by: Jens Axboe <ax...@kernel.dk>
---

diff -Nupr a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c
--- a/drbd/drbd_receiver.c      2022-07-08 06:55:17.451589834 +0800
+++ b/drbd/drbd_receiver.c      2022-07-08 06:59:24.486571488 +0800
@@ -1263,7 +1263,8 @@ static void one_flush_endio(struct bio *
 
 static void submit_one_flush(struct drbd_device *device, struct 
issue_flush_context *ctx)
 {
-       struct bio *bio = bio_alloc(GFP_NOIO, 0);
+       struct bio *bio = bio_alloc(device->ldev->backing_bdev, 0,
+                                   REQ_OP_FLUSH | REQ_PREFLUSH, GFP_NOIO);
        struct one_flush_context *octx = kmalloc(sizeof(*octx), GFP_NOIO);
        if (!bio || !octx) {
                drbd_warn(device, "Could not allocate a bio, CANNOT ISSUE 
FLUSH\n");
@@ -1283,14 +1284,12 @@ static void submit_one_flush(struct drbd
 
        octx->device = device;
        octx->ctx = ctx;
-       bio_set_dev(bio, device->ldev->backing_bdev);
        bio->bi_private = octx;
        bio->bi_end_io = one_flush_endio;
 
        device->flush_jif = jiffies;
        set_bit(FLUSH_PENDING, &device->flags);
        atomic_inc(&ctx->pending);
-       bio->bi_opf = REQ_OP_FLUSH | REQ_PREFLUSH;
        submit_bio(bio);
 }
 
@@ -1832,17 +1831,14 @@ next_bio:
                goto fail;
        }
 
-       bio = bio_alloc(GFP_NOIO, nr_pages);
+       bio = bio_alloc(device->ldev->backing_bdev, nr_pages, peer_req->opf,
+                       GFP_NOIO);
        if (!bio) {
                drbd_err(device, "submit_ee: Allocation of a bio failed 
(nr_pages=%u)\n", nr_pages);
                goto fail;
        }
        /* > peer_req->i.sector, unless this is the first bio */
        bio->bi_iter.bi_sector = sector;
-       bio_set_dev(bio, device->ldev->backing_bdev);
-       /* we special case some flags in the multi-bio case, see below
-        * (REQ_PREFLUSH, or BIO_RW_BARRIER in older kernels) */
-       bio->bi_opf = peer_req->opf;
        bio->bi_private = peer_req;
        bio->bi_end_io = drbd_peer_request_endio;
 

++++++ bsc-1201335_06-bdi.patch ++++++
/* this patch is related with following 3 upstream kernel commits */

commit 8fd6533ef3f7729e4aa29ead83844c042688615a
Author: Haowen Bai <baihao...@meizu.com>
Date:   Wed Apr 6 21:07:15 2022 +0200

    drbd: Return true/false (not 1/0) from bool functions

    Return boolean values ("true" or "false") instead of 1 or 0 from bool
    functions.  This fixes the following warnings from coccicheck:

    ./drivers/block/drbd/drbd_req.c:912:9-10: WARNING: return of 0/1 in
    function 'remote_due_to_read_balancing' with return type bool

    Signed-off-by: Haowen Bai <baihao...@meizu.com>
    Reviewed-by: Christoph B??hmwalder <christoph.boehmwal...@linbit.com>
    Link: 
https://lore.kernel.org/r/20220406190715.1938174-8-christoph.boehmwal...@linbit.com
    Signed-off-by: Jens Axboe <ax...@kernel.dk>

---
commit b9b1335e640308acc1b8f26c739b804c80a6c147
Author: NeilBrown <ne...@suse.de>
Date:   Tue Mar 22 14:39:10 2022 -0700

    remove bdi_congested() and wb_congested() and related functions

    These functions are no longer useful as no BDIs report congestions any
    more.

    Removing the test on bdi_write_contested() in current_may_throttle()
    could cause a small change in behaviour, but only when PF_LOCAL_THROTTLE
    is set.

    So replace the calls by 'false' and simplify the code - and remove the
    functions.

    [a...@linux-foundation.org: fix build]

    Link: 
https://lkml.kernel.org/r/164549983742.9187.2570198746005819592.stgit@noble.brown
    Signed-off-by: NeilBrown <ne...@suse.de>
    Acked-by: Ryusuke Konishi <konishi.ryus...@gmail.com>   [nilfs]
    Cc: Anna Schumaker <anna.schuma...@netapp.com>
    Cc: Chao Yu <c...@kernel.org>
    Cc: Darrick J. Wong <djw...@kernel.org>
    Cc: Ilya Dryomov <idryo...@gmail.com>
    Cc: Jaegeuk Kim <jaeg...@kernel.org>
    Cc: Jan Kara <j...@suse.cz>
    Cc: Jeff Layton <jlay...@kernel.org>
    Cc: Jens Axboe <ax...@kernel.dk>
    Cc: Lars Ellenberg <lars.ellenb...@linbit.com>
    Cc: Miklos Szeredi <mik...@szeredi.hu>
    Cc: Paolo Valente <paolo.vale...@linaro.org>
    Cc: Philipp Reisner <philipp.reis...@linbit.com>
    Cc: Trond Myklebust <trond.mykleb...@hammerspace.com>
    Cc: Wu Fengguang <fengguang...@intel.com>
    Signed-off-by: Andrew Morton <a...@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>

---
commit edb0872f44ec9976ea6d052cb4b93cd2d23ac2ba
Author: Christoph Hellwig <h...@lst.de>
Date:   Mon Aug 9 16:17:43 2021 +0200

    block: move the bdi from the request_queue to the gendisk

    The backing device information only makes sense for file system I/O,
    and thus belongs into the gendisk and not the lower level request_queue
    structure.  Move it there.

    Signed-off-by: Christoph Hellwig <h...@lst.de>
    Reviewed-by: Johannes Thumshirn <johannes.thumsh...@wdc.com>
    Link: https://lore.kernel.org/r/20210809141744.1203023-5-...@lst.de
    Signed-off-by: Jens Axboe <ax...@kernel.dk>

---

diff -Nupr a/drbd/drbd_req.c b/drbd/drbd_req.c
--- a/drbd/drbd_req.c   2022-07-08 18:08:35.075249173 +0800
+++ b/drbd/drbd_req.c   2022-07-08 07:50:00.750419154 +0800
@@ -1148,13 +1148,11 @@ static bool remote_due_to_read_balancing
                struct drbd_peer_device *peer_device, sector_t sector,
                enum drbd_read_balancing rbm)
 {
-       struct backing_dev_info *bdi;
        int stripe_shift;
 
        switch (rbm) {
        case RB_CONGESTED_REMOTE:
-               bdi = 
device->ldev->backing_bdev->bd_disk->queue->backing_dev_info;
-               return bdi_read_congested(bdi);
+               return false;
        case RB_LEAST_PENDING:
                return atomic_read(&device->local_cnt) >
                        atomic_read(&peer_device->ap_pending_cnt) + 
atomic_read(&peer_device->rs_pending_cnt);
diff -Nupr a/drbd/drbd_nl.c b/drbd/drbd_nl.c
--- a/drbd/drbd_nl.c    2022-07-08 08:50:52.751580529 +0800
+++ b/drbd/drbd_nl.c    2022-07-08 08:51:20.971464720 +0800
@@ -5593,7 +5593,6 @@ static void device_to_statistics(struct
        if (get_ldev(device)) {
                struct drbd_md *md = &device->ldev->md;
                u64 *history_uuids = (u64 *)s->history_uuids;
-               struct request_queue *q;
                int n;
 
                spin_lock_irq(&md->uuid_lock);
@@ -5605,11 +5604,6 @@ static void device_to_statistics(struct
                spin_unlock_irq(&md->uuid_lock);
 
                s->dev_disk_flags = md->flags;
-               q = bdev_get_queue(device->ldev->backing_bdev);
-               s->dev_lower_blocked =
-                       bdi_congested(q->backing_dev_info,
-                                     (1 << WB_async_congested) |
-                                     (1 << WB_sync_congested));
                put_ldev(device);
        }
        s->dev_size = get_capacity(device->vdisk);

++++++ bsc-1201335_07-write-same.patch ++++++
/* this patch is related with following upstream kernel commit */

commit a34592ff6b78e84e11b19183b60cd240737f76f9
Author: Christoph Hellwig <h...@lst.de>
Date:   Wed Feb 9 09:28:23 2022 +0100

    scsi: drbd: Remove WRITE_SAME support
    
    REQ_OP_WRITE_SAME was only ever submitted by the legacy Linux zeroing code,
    which has switched to use REQ_OP_WRITE_ZEROES long ago.
    
    Link: https://lore.kernel.org/r/20220209082828.2629273-3-...@lst.de
    Signed-off-by: Christoph Hellwig <h...@lst.de>
    Signed-off-by: Martin K. Petersen <martin.peter...@oracle.com>
---

diff -Nupr a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c
--- a/drbd/drbd_receiver.c      2022-07-08 07:14:26.331017361 +0800
+++ b/drbd/drbd_receiver.c      2022-07-08 07:14:57.750893198 +0800
@@ -2737,8 +2737,6 @@ static unsigned long wire_flags_to_bio_o
                return REQ_OP_WRITE_ZEROES;
        if (dpf & DP_DISCARD)
                return REQ_OP_DISCARD;
-       if (dpf & DP_WSAME)
-               return REQ_OP_WRITE_SAME;
        else
                return REQ_OP_WRITE;
 }

++++++ bsc-1201335_08-bio_clone_fast.patch ++++++
/* this patch is related with following upstream kernel commit */

commit abfc426d1b2fb2176df59851a64223b58ddae7e7
Author: Christoph Hellwig <h...@lst.de>
Date:   Wed Feb 2 17:01:09 2022 +0100

    block: pass a block_device to bio_clone_fast
    
    Pass a block_device to bio_clone_fast and __bio_clone_fast and give
    the functions more suitable names.
    
    Signed-off-by: Christoph Hellwig <h...@lst.de>
    Reviewed-by: Mike Snitzer <snit...@redhat.com>
    Link: https://lore.kernel.org/r/20220202160109.108149-14-...@lst.de
    Signed-off-by: Jens Axboe <ax...@kernel.dk>
---

diff -Nupr a/drbd/drbd_req.c b/drbd/drbd_req.c
--- a/drbd/drbd_req.c   2022-07-08 08:00:58.007783979 +0800
+++ b/drbd/drbd_req.c   2022-07-08 08:09:29.157733345 +0800
@@ -1543,7 +1543,8 @@ drbd_request_prepare(struct drbd_device
        req->start_jif = bio_start_io_acct(req->master_bio);
 
        if (get_ldev(device)) {
-               req->private_bio  = bio_clone_fast(bio, GFP_NOIO, 
&drbd_io_bio_set);
+               req->private_bio  = bio_alloc_clone(device->ldev->backing_bdev, 
bio,
+                                                       GFP_NOIO, 
&drbd_io_bio_set);
                req->private_bio->bi_private = req;
                req->private_bio->bi_end_io = drbd_request_endio;
        }

Reply via email to