Accepting request 932870 from home:wanghaisu:branches:network:ha-clustering:Factory
bsc#1192929, compat to kernel v5.15 OBS-URL: https://build.opensuse.org/request/show/932870 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=136
This commit is contained in:
parent
132c70a03d
commit
43a00e1438
26
add_disk_error_handle.patch
Normal file
26
add_disk_error_handle.patch
Normal file
@ -0,0 +1,26 @@
|
||||
/* {"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);
|
@ -1,98 +0,0 @@
|
||||
b647ad024841d02d67e78716f51f355d8d3e9656
|
||||
Conver blk_alloc_queue to blk_alloc_disk
|
||||
|
||||
diff -Naur drbd-9.0.30~1+git.10bee2d5.orig/drbd/drbd-kernel-compat/tests/have_blk_alloc_disk.c drbd-9.0.30~1+git.10bee2d5/drbd/drbd-kernel-compat/tests/have_blk_alloc_disk.c
|
||||
--- drbd-9.0.30~1+git.10bee2d5.orig/drbd/drbd-kernel-compat/tests/have_blk_alloc_disk.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.30~1+git.10bee2d5/drbd/drbd-kernel-compat/tests/have_blk_alloc_disk.c 2021-07-26 13:56:29.805439136 +0800
|
||||
@@ -0,0 +1,8 @@
|
||||
+/* {"version":"v5.14-rc1", "commit": "f525464a8000f092c20b00eead3eaa9d849c599e", "comment": "block: add blk_alloc_disk and blk_cleanup_disk APIs, "author": "Christoph Hellwig <hch@lst.de>", "date": "Fri May 21 07:50:55 2021 +0200" } */
|
||||
+/*{"version":"v5.14-rc1", "commit": "b647ad024841d02d67e78716f51f355d8d3e9656", "comment": "drbd: convert to blk_alloc_disk/blk_cleanup_disk", "author": "Christoph Hellwig <hch@lst.de>", "date": "Fri May 21 07:50:57 2021 +0200" }*/
|
||||
+#include <linux/genhd.h>
|
||||
+
|
||||
+void dummy(void)
|
||||
+{
|
||||
+ blk_alloc_disk(0);
|
||||
+}
|
||||
diff -Naur drbd-9.0.30~1+git.10bee2d5.orig/drbd/drbd_main.c drbd-9.0.30~1+git.10bee2d5/drbd/drbd_main.c
|
||||
--- drbd-9.0.30~1+git.10bee2d5.orig/drbd/drbd_main.c 2021-07-26 13:56:15.381311173 +0800
|
||||
+++ drbd-9.0.30~1+git.10bee2d5/drbd/drbd_main.c 2021-07-26 13:58:19.070408470 +0800
|
||||
@@ -2934,8 +2934,12 @@
|
||||
device->bitmap = NULL;
|
||||
}
|
||||
|
||||
+#ifdef COMPAT_HAVE_BLK_ALLOC_DISK
|
||||
+ blk_cleanup_disk(device->vdisk);
|
||||
+#else
|
||||
put_disk(device->vdisk);
|
||||
blk_cleanup_queue(device->rq_queue);
|
||||
+#endif
|
||||
|
||||
kfree(device);
|
||||
|
||||
@@ -3654,7 +3658,9 @@
|
||||
struct drbd_device *device;
|
||||
struct drbd_peer_device *peer_device, *tmp_peer_device;
|
||||
struct gendisk *disk;
|
||||
+#ifndef COMPAT_HAVE_BLK_ALLOC_DISK
|
||||
struct request_queue *q;
|
||||
+#endif
|
||||
LIST_HEAD(peer_devices);
|
||||
LIST_HEAD(tmp);
|
||||
int id;
|
||||
@@ -3719,25 +3725,39 @@
|
||||
|
||||
init_rwsem(&device->uuid_sem);
|
||||
|
||||
+#ifdef COMPAT_HAVE_BLK_ALLOC_DISK
|
||||
+ disk = blk_alloc_disk(NUMA_NO_NODE);
|
||||
+#else
|
||||
q = blk_alloc_queue(NUMA_NO_NODE);
|
||||
if (!q)
|
||||
goto out_no_q;
|
||||
device->rq_queue = q;
|
||||
|
||||
disk = alloc_disk(1);
|
||||
+#endif
|
||||
if (!disk)
|
||||
goto out_no_disk;
|
||||
device->vdisk = disk;
|
||||
-
|
||||
+#ifdef COMPAT_HAVE_BLK_ALLOC_DISK
|
||||
+ device->rq_queue = disk->queue;
|
||||
+ disk->minors = 1;
|
||||
+#else
|
||||
disk->queue = q;
|
||||
+#endif
|
||||
+
|
||||
disk->major = DRBD_MAJOR;
|
||||
disk->first_minor = minor;
|
||||
disk->fops = &drbd_ops;
|
||||
sprintf(disk->disk_name, "drbd%d", minor);
|
||||
disk->private_data = device;
|
||||
|
||||
+#ifdef COMPAT_HAVE_BLK_ALLOC_DISK
|
||||
+ blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
|
||||
+ blk_queue_write_cache(disk->queue, true, true);
|
||||
+#else
|
||||
blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, q);
|
||||
blk_queue_write_cache(q, true, true);
|
||||
+#endif
|
||||
|
||||
device->md_io.page = alloc_page(GFP_KERNEL);
|
||||
if (!device->md_io.page)
|
||||
@@ -3866,10 +3886,15 @@
|
||||
out_no_bitmap:
|
||||
__free_page(device->md_io.page);
|
||||
out_no_io_page:
|
||||
+#ifdef COMPAT_HAVE_BLK_ALLOC_DISK
|
||||
+ blk_cleanup_disk(disk);
|
||||
+out_no_disk:
|
||||
+#else
|
||||
put_disk(disk);
|
||||
out_no_disk:
|
||||
blk_cleanup_queue(q);
|
||||
out_no_q:
|
||||
+#endif
|
||||
kref_put(&resource->kref, drbd_destroy_resource);
|
||||
kref_debug_put(&resource->kref_debug, 4);
|
||||
/* kref debugging wants an extra put, see has_refs() */
|
107
dax_support.patch
Normal file
107
dax_support.patch
Normal file
@ -0,0 +1,107 @@
|
||||
/* {"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 */
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:da6711057a07b70c939b9ca6f271eba3e5fa141cdd536a37d8fd182666f52a16
|
||||
size 372020
|
3
drbd-9.0.30~1+git.8e9c0812.tar.bz2
Normal file
3
drbd-9.0.30~1+git.8e9c0812.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:79d58db5907e8fe69a34ade98a174d3375d25998675eb61e555d6ff74d8cce5e
|
||||
size 372369
|
15
drbd.changes
15
drbd.changes
@ -1,3 +1,18 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 22 04:38:30 UTC 2021 - nick wang <nwang@suse.com>
|
||||
|
||||
- bsc#1192929, compat to kernel v5.15
|
||||
- Remove patch convert_to_blk_alloc_disk.patch (upstream)
|
||||
- Add patch make_block_holder_optional.patch
|
||||
Add patch move_kvmalloc_related_to_slab.patch
|
||||
Add patch polling_to_bio_base.patch
|
||||
Add patch pass_gend_to_blk_queue_update_readahead.patch
|
||||
Add patch move_bdi_from_request_queue_to_gendisk.patch
|
||||
Add patch dax_support.patch
|
||||
Add patch add_disk_error_handle.patch
|
||||
Add patch have_void_drbd_submit_bio.patch
|
||||
Add patch remove_bdgrab.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 21 06:23:09 UTC 2021 - nick wang <nwang@suse.com>
|
||||
|
||||
|
20
drbd.spec
20
drbd.spec
@ -24,7 +24,7 @@
|
||||
%endif
|
||||
%endif
|
||||
Name: drbd
|
||||
Version: 9.0.30~1+git.10bee2d5
|
||||
Version: 9.0.30~1+git.8e9c0812
|
||||
Release: 0
|
||||
Summary: Linux driver for the "Distributed Replicated Block Device"
|
||||
License: GPL-2.0-or-later
|
||||
@ -35,7 +35,15 @@ Source1: preamble
|
||||
Source2: Module.supported
|
||||
Source3: drbd_git_revision
|
||||
Patch1: fix-resync-finished-with-syncs-have-bits-set.patch
|
||||
Patch2: convert_to_blk_alloc_disk.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
|
||||
Patch99: suse-coccinelle.patch
|
||||
#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py
|
||||
BuildRequires: coccinelle >= 1.0.8
|
||||
@ -71,6 +79,14 @@ installed kernel.
|
||||
%setup -q -n drbd-%{version}
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch99 -p1
|
||||
|
||||
mkdir source
|
||||
|
@ -1 +1 @@
|
||||
GIT-hash: 10bee2d57dcbc48836ac61bad434590b7b82917e
|
||||
GIT-hash: 8e9c08122ae738eec189abe402ba7358b57182cd
|
||||
|
84
have_void_drbd_submit_bio.patch
Normal file
84
have_void_drbd_submit_bio.patch
Normal file
@ -0,0 +1,84 @@
|
||||
/* {"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 <hch@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,
|
31
make_block_holder_optional.patch
Normal file
31
make_block_holder_optional.patch
Normal file
@ -0,0 +1,31 @@
|
||||
/* {"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
|
84
move_bdi_from_request_queue_to_gendisk.patch
Normal file
84
move_bdi_from_request_queue_to_gendisk.patch
Normal file
@ -0,0 +1,84 @@
|
||||
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-22 14:00:22.158226957 +0800
|
||||
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/gen_patch_names.c 2021-11-22 14:10:47.141520981 +0800
|
||||
@@ -396,8 +396,10 @@
|
||||
COMPAT_HAVE_BLK_QUEUE_UPDATE_READAHEAD, "present");
|
||||
#endif
|
||||
|
||||
+#ifndef COMPAT_HAVE_GENDISK_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");
|
||||
diff -Naur drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_gendisk_backing_dev_info.c drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_gendisk_backing_dev_info.c
|
||||
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd-kernel-compat/tests/have_gendisk_backing_dev_info.c 1970-01-01 08:00:00.000000000 +0800
|
||||
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd-kernel-compat/tests/have_gendisk_backing_dev_info.c 2021-11-22 14:08:58.564950244 +0800
|
||||
@@ -0,0 +1,11 @@
|
||||
+/* { "version": "v5.15-rc1~161", "commit": "edb0872f44ec9976ea6d052cb4b93cd2d23ac2ba", "comment": "block: move the bdi from the request_queue to the gendisk", "author": "Christoph Hellwig <hch@lst.de>", "date": "Mon Aug 9 16:17:43 2021 +0200" } */
|
||||
+
|
||||
+
|
||||
+#include <linux/genhd.h>
|
||||
+#include <linux/backing-dev-defs.h>
|
||||
+
|
||||
+void dummy(struct gendisk *gd)
|
||||
+{
|
||||
+ struct backing_dev_info *b;
|
||||
+ b = gd->bdi;
|
||||
+}
|
||||
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 14:00:22.158226957 +0800
|
||||
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_nl.c 2021-11-22 14:40:51.131336874 +0800
|
||||
@@ -5594,7 +5594,9 @@
|
||||
if (get_ldev(device)) {
|
||||
struct drbd_md *md = &device->ldev->md;
|
||||
u64 *history_uuids = (u64 *)s->history_uuids;
|
||||
+#ifndef COMPAT_HAVE_GENDISK_BACKING_DEV_INFO
|
||||
struct request_queue *q;
|
||||
+#endif
|
||||
int n;
|
||||
|
||||
spin_lock_irq(&md->uuid_lock);
|
||||
@@ -5606,11 +5608,18 @@
|
||||
spin_unlock_irq(&md->uuid_lock);
|
||||
|
||||
s->dev_disk_flags = md->flags;
|
||||
+#ifndef COMPAT_HAVE_GENDISK_BACKING_DEV_INFO
|
||||
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));
|
||||
+#else
|
||||
+ s->dev_lower_blocked =
|
||||
+ bdi_congested(device->ldev->backing_bdev->bd_disk->bdi,
|
||||
+ (1 << WB_async_congested) |
|
||||
+ (1 << WB_sync_congested));
|
||||
+#endif
|
||||
put_ldev(device);
|
||||
}
|
||||
s->dev_size = get_capacity(device->vdisk);
|
||||
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-22 14:00:22.158226957 +0800
|
||||
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_req.c 2021-11-22 14:15:43.103076717 +0800
|
||||
@@ -1148,13 +1148,19 @@
|
||||
struct drbd_peer_device *peer_device, sector_t sector,
|
||||
enum drbd_read_balancing rbm)
|
||||
{
|
||||
+#ifndef COMPAT_HAVE_GENDISK_BACKING_DEV_INFO
|
||||
struct backing_dev_info *bdi;
|
||||
+#endif
|
||||
int stripe_shift;
|
||||
|
||||
switch (rbm) {
|
||||
case RB_CONGESTED_REMOTE:
|
||||
+#ifndef COMPAT_HAVE_GENDISK_BACKING_DEV_INFO
|
||||
bdi = device->ldev->backing_bdev->bd_disk->queue->backing_dev_info;
|
||||
return bdi_read_congested(bdi);
|
||||
+#else
|
||||
+ return bdi_read_congested(device->ldev->backing_bdev->bd_disk->bdi);
|
||||
+#endif
|
||||
case RB_LEAST_PENDING:
|
||||
return atomic_read(&device->local_cnt) >
|
||||
atomic_read(&peer_device->ap_pending_cnt) + atomic_read(&peer_device->rs_pending_cnt);
|
11
move_kvmalloc_related_to_slab.patch
Normal file
11
move_kvmalloc_related_to_slab.patch
Normal file
@ -0,0 +1,11 @@
|
||||
/* {"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);
|
44
pass_gend_to_blk_queue_update_readahead.patch
Normal file
44
pass_gend_to_blk_queue_update_readahead.patch
Normal file
@ -0,0 +1,44 @@
|
||||
/* {"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 <hch@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);
|
14
polling_to_bio_base.patch
Normal file
14
polling_to_bio_base.patch
Normal file
@ -0,0 +1,14 @@
|
||||
/* {"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);
|
||||
}
|
17
remove_bdgrab.patch
Normal file
17
remove_bdgrab.patch
Normal file
@ -0,0 +1,17 @@
|
||||
/* {"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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user