]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/pve/0053-Revert-block-rbd-workaround-for-ceph-issue-53784.patch
add QAPI naming exceptions in patches introducing them
[pve-qemu.git] / debian / patches / pve / 0053-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 ---
11 block/rbd.c | 42 ++----------------------------------------
12 1 file changed, 2 insertions(+), 40 deletions(-)
13
14 diff --git a/block/rbd.c b/block/rbd.c
15 index 64a8d7d48b..9fc6dcb957 100644
16 --- a/block/rbd.c
17 +++ b/block/rbd.c
18 @@ -1348,7 +1348,6 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
19 int status, r;
20 RBDDiffIterateReq req = { .offs = offset };
21 uint64_t features, flags;
22 - uint64_t head = 0;
23
24 assert(offset + bytes <= s->image_size);
25
26 @@ -1376,43 +1375,7 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
27 return status;
28 }
29
30 -#if LIBRBD_VERSION_CODE < LIBRBD_VERSION(1, 17, 0)
31 - /*
32 - * librbd had a bug until early 2022 that affected all versions of ceph that
33 - * supported fast-diff. This bug results in reporting of incorrect offsets
34 - * if the offset parameter to rbd_diff_iterate2 is not object aligned.
35 - * Work around this bug by rounding down the offset to object boundaries.
36 - * This is OK because we call rbd_diff_iterate2 with whole_object = true.
37 - * However, this workaround only works for non cloned images with default
38 - * striping.
39 - *
40 - * See: https://tracker.ceph.com/issues/53784
41 - */
42 -
43 - /* check if RBD image has non-default striping enabled */
44 - if (features & RBD_FEATURE_STRIPINGV2) {
45 - return status;
46 - }
47 -
48 -#pragma GCC diagnostic push
49 -#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
50 - /*
51 - * check if RBD image is a clone (= has a parent).
52 - *
53 - * rbd_get_parent_info is deprecated from Nautilus onwards, but the
54 - * replacement rbd_get_parent is not present in Luminous and Mimic.
55 - */
56 - if (rbd_get_parent_info(s->image, NULL, 0, NULL, 0, NULL, 0) != -ENOENT) {
57 - return status;
58 - }
59 -#pragma GCC diagnostic pop
60 -
61 - head = req.offs & (s->object_size - 1);
62 - req.offs -= head;
63 - bytes += head;
64 -#endif
65 -
66 - r = rbd_diff_iterate2(s->image, NULL, req.offs, bytes, true, true,
67 + r = rbd_diff_iterate2(s->image, NULL, offset, bytes, true, true,
68 qemu_rbd_diff_iterate_cb, &req);
69 if (r < 0 && r != QEMU_RBD_EXIT_DIFF_ITERATE2) {
70 return status;
71 @@ -1431,8 +1394,7 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
72 status = BDRV_BLOCK_ZERO | BDRV_BLOCK_OFFSET_VALID;
73 }
74
75 - assert(req.bytes > head);
76 - *pnum = req.bytes - head;
77 + *pnum = req.bytes;
78 return status;
79 }
80