]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/pve/0040-Revert-block-rbd-workaround-for-ceph-issue-53784.patch
backup: factor out & clean up gathering device info into helper
[pve-qemu.git] / debian / patches / pve / 0040-Revert-block-rbd-workaround-for-ceph-issue-53784.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Fabian Ebner <f.ebner@proxmox.com>
3 Date: Thu, 23 Jun 2022 14:00:05 +0200
4 Subject: [PATCH] Revert "block/rbd: workaround for ceph issue #53784"
5
6 This reverts commit fc176116cdea816ceb8dd969080b2b95f58edbc0 in
7 preparation to revert 0347a8fd4c3faaedf119be04c197804be40a384b.
8
9 Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
10 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 ---
12 block/rbd.c | 42 ++----------------------------------------
13 1 file changed, 2 insertions(+), 40 deletions(-)
14
15 diff --git a/block/rbd.c b/block/rbd.c
16 index a4749f3b1b..53e0396b51 100644
17 --- a/block/rbd.c
18 +++ b/block/rbd.c
19 @@ -1511,7 +1511,6 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
20 int status, r;
21 RBDDiffIterateReq req = { .offs = offset };
22 uint64_t features, flags;
23 - uint64_t head = 0;
24
25 assert(offset + bytes <= s->image_size);
26
27 @@ -1539,43 +1538,7 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
28 return status;
29 }
30
31 -#if LIBRBD_VERSION_CODE < LIBRBD_VERSION(1, 17, 0)
32 - /*
33 - * librbd had a bug until early 2022 that affected all versions of ceph that
34 - * supported fast-diff. This bug results in reporting of incorrect offsets
35 - * if the offset parameter to rbd_diff_iterate2 is not object aligned.
36 - * Work around this bug by rounding down the offset to object boundaries.
37 - * This is OK because we call rbd_diff_iterate2 with whole_object = true.
38 - * However, this workaround only works for non cloned images with default
39 - * striping.
40 - *
41 - * See: https://tracker.ceph.com/issues/53784
42 - */
43 -
44 - /* check if RBD image has non-default striping enabled */
45 - if (features & RBD_FEATURE_STRIPINGV2) {
46 - return status;
47 - }
48 -
49 -#pragma GCC diagnostic push
50 -#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
51 - /*
52 - * check if RBD image is a clone (= has a parent).
53 - *
54 - * rbd_get_parent_info is deprecated from Nautilus onwards, but the
55 - * replacement rbd_get_parent is not present in Luminous and Mimic.
56 - */
57 - if (rbd_get_parent_info(s->image, NULL, 0, NULL, 0, NULL, 0) != -ENOENT) {
58 - return status;
59 - }
60 -#pragma GCC diagnostic pop
61 -
62 - head = req.offs & (s->object_size - 1);
63 - req.offs -= head;
64 - bytes += head;
65 -#endif
66 -
67 - r = rbd_diff_iterate2(s->image, NULL, req.offs, bytes, true, true,
68 + r = rbd_diff_iterate2(s->image, NULL, offset, bytes, true, true,
69 qemu_rbd_diff_iterate_cb, &req);
70 if (r < 0 && r != QEMU_RBD_EXIT_DIFF_ITERATE2) {
71 return status;
72 @@ -1594,8 +1557,7 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
73 status = BDRV_BLOCK_ZERO | BDRV_BLOCK_OFFSET_VALID;
74 }
75
76 - assert(req.bytes > head);
77 - *pnum = req.bytes - head;
78 + *pnum = req.bytes;
79 return status;
80 }
81