Merge ~paelzer/ubuntu/+source/qemu:lp-1246924-enable-glusterfs into ubuntu/+source/qemu:ubuntu/jammy-devel

Proposed by Christian Ehrhardt 
Status: Merged
Merge reported by: Christian Ehrhardt 
Merged at revision: 684fd902d2456fa3d683ba8a72bb7f35fccce6ca
Proposed branch: ~paelzer/ubuntu/+source/qemu:lp-1246924-enable-glusterfs
Merge into: ubuntu/+source/qemu:ubuntu/jammy-devel
Diff against target: 223 lines (+167/-4)
6 files modified
debian/changelog (+9/-0)
debian/control (+2/-1)
debian/control-in (+2/-3)
debian/patches/series (+2/-0)
debian/patches/ubuntu/lp-1968258-block-rbd-fix-handling-of-holes-in-.bdrv_co.patch (+54/-0)
debian/patches/ubuntu/lp-1968258-block-rbd-workaround-for-ceph-issue-53784.patch (+98/-0)
Reviewer Review Type Date Requested Status
Utkarsh Gupta (community) Needs Information
Canonical Server packageset reviewers Pending
git-ubuntu import Pending
Review via email: mp+418926@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI: I also added bug 1968258 as data corruption is kind of bad and we'd SRU it anyway we can as well fix it before release as part of the upload we need for glusterfs anyway.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI - glusterfs change merged in Debian (thanks MJT)

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Okay, looks good, I think! +1.

review: Approve
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hey, hold on a sec. GlusterFS is not built on i386, so should it not be [!i386] instead of [linux-any], instead?

review: Needs Information
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Clarified via IRC, due to not being built there
https://people.canonical.com/~ubuntu-archive/germinate-output/i386.jammy/i386+build-depends
this way it allows us to have less delta.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Uploaded to get the MIR to the next stage:

Uploading qemu_6.2+dfsg-2ubuntu6.dsc
Uploading qemu_6.2+dfsg-2ubuntu6.debian.tar.xz
Uploading qemu_6.2+dfsg-2ubuntu6_source.buildinfo
Uploading qemu_6.2+dfsg-2ubuntu6_source.changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index c78e675..3ec2625 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
1qemu (1:6.2+dfsg-2ubuntu6) jammy; urgency=medium
2
3 * debian/control[-in]: no more disable glusterfs in Ubuntu (LP: #1246924)
4 * Fix diff handling on ceph that can cause data corruption (LP: #1968258)
5 - d/p/u/lp-1968258-block-rbd-fix-handling-of-holes-in-.bdrv_co.patch
6 - d/p/u/lp-1968258-block-rbd-workaround-for-ceph-issue-53784.patch
7
8 -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Fri, 08 Apr 2022 09:36:34 +0200
9
1qemu (1:6.2+dfsg-2ubuntu5) jammy; urgency=medium10qemu (1:6.2+dfsg-2ubuntu5) jammy; urgency=medium
211
3 * d/p/u/tcg-Remove-dh_alias-indirection-for-dh_typecode.patch: fix 32bit12 * d/p/u/tcg-Remove-dh_alias-indirection-for-dh_typecode.patch: fix 32bit
diff --git a/debian/control b/debian/control
index f485609..00627d8 100644
--- a/debian/control
+++ b/debian/control
@@ -59,8 +59,9 @@ Build-Depends: debhelper-compat (= 12),
59 libpixman-1-dev,59 libpixman-1-dev,
60# --enable-rbd amd64|arm64|armel|armhf|i386|mips64el|mipsel|ppc64el|s390x|ppc64|sparc6460# --enable-rbd amd64|arm64|armel|armhf|i386|mips64el|mipsel|ppc64el|s390x|ppc64|sparc64
61 librbd-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x ppc64 sparc64],61 librbd-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x ppc64 sparc64],
62# glusterfs is debian-only since ubuntu/glusterfs is in universe (MIR LP: #1274247)
63# before buster it was glusterfs-common so keep it for now for bpo62# before buster it was glusterfs-common so keep it for now for bpo
63# --enable-glusterfs linux-any
64 libglusterfs-dev [linux-any] | glusterfs-common [linux-any],
64# --enable-vnc-sasl65# --enable-vnc-sasl
65 libsasl2-dev,66 libsasl2-dev,
66# --enable-sdl67# --enable-sdl
diff --git a/debian/control-in b/debian/control-in
index 80e2b77..6754533 100644
--- a/debian/control-in
+++ b/debian/control-in
@@ -63,10 +63,9 @@ Build-Depends: debhelper-compat (= 12),
63 libpixman-1-dev,63 libpixman-1-dev,
64# --enable-rbd amd64|arm64|armel|armhf|i386|mips64el|mipsel|ppc64el|s390x|ppc64|sparc6464# --enable-rbd amd64|arm64|armel|armhf|i386|mips64el|mipsel|ppc64el|s390x|ppc64|sparc64
65 librbd-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x ppc64 sparc64],65 librbd-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x ppc64 sparc64],
66# glusterfs is debian-only since ubuntu/glusterfs is in universe (MIR LP: #1274247)
67# before buster it was glusterfs-common so keep it for now for bpo66# before buster it was glusterfs-common so keep it for now for bpo
68:debian:# --enable-glusterfs linux-any67# --enable-glusterfs linux-any
69:debian: libglusterfs-dev [linux-any] | glusterfs-common [linux-any],68 libglusterfs-dev [linux-any] | glusterfs-common [linux-any],
70# --enable-vnc-sasl69# --enable-vnc-sasl
71 libsasl2-dev,70 libsasl2-dev,
72# --enable-sdl71# --enable-sdl
diff --git a/debian/patches/series b/debian/patches/series
index d136bfb..ab3291d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -27,3 +27,5 @@ ubuntu/lp-1952448-relax-skiboot-gcc-deprecation-errors.patch
27ubuntu/lp-1959984-s390x-ipl-support-extended-kernel-command-line-size.patch27ubuntu/lp-1959984-s390x-ipl-support-extended-kernel-command-line-size.patch
28ubuntu/fix-virtiofsd-for-glibc2.35.patch28ubuntu/fix-virtiofsd-for-glibc2.35.patch
29ubuntu/tcg-Remove-dh_alias-indirection-for-dh_typecode.patch29ubuntu/tcg-Remove-dh_alias-indirection-for-dh_typecode.patch
30ubuntu/lp-1968258-block-rbd-fix-handling-of-holes-in-.bdrv_co.patch
31ubuntu/lp-1968258-block-rbd-workaround-for-ceph-issue-53784.patch
diff --git a/debian/patches/ubuntu/lp-1968258-block-rbd-fix-handling-of-holes-in-.bdrv_co.patch b/debian/patches/ubuntu/lp-1968258-block-rbd-fix-handling-of-holes-in-.bdrv_co.patch
30new file mode 10064432new file mode 100644
index 0000000..26d0f60
--- /dev/null
+++ b/debian/patches/ubuntu/lp-1968258-block-rbd-fix-handling-of-holes-in-.bdrv_co.patch
@@ -0,0 +1,54 @@
1From 9e302f64bb407a9bb097b626da97228c2654cfee Mon Sep 17 00:00:00 2001
2From: Peter Lieven <pl@kamp.de>
3Date: Thu, 13 Jan 2022 15:44:25 +0100
4Subject: [PATCH] block/rbd: fix handling of holes in .bdrv_co_block_status
5
6the assumption that we can't hit a hole if we do not diff against a snapshot was wrong.
7
8We can see a hole in an image if we diff against base if there exists an older snapshot
9of the image and we have discarded blocks in the image where the snapshot has data.
10
11Fix this by simply handling a hole like an unallocated area. There are no callbacks
12for unallocated areas so just bail out if we hit a hole.
13
14Fixes: 0347a8fd4c3faaedf119be04c197804be40a384b
15Suggested-by: Ilya Dryomov <idryomov@gmail.com>
16Cc: qemu-stable@nongnu.org
17Signed-off-by: Peter Lieven <pl@kamp.de>
18Message-Id: <20220113144426.4036493-2-pl@kamp.de>
19Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
20Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
21Signed-off-by: Kevin Wolf <kwolf@redhat.com>
22
23Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=9e302f64bb407a9bb097b626da97
24Bug-Ubuntu: https://bugs.launchpad.net/bugs/1968258
25Last-Update: 2022-04-08
26
27---
28 block/rbd.c | 10 +++++-----
29 1 file changed, 5 insertions(+), 5 deletions(-)
30
31diff --git a/block/rbd.c b/block/rbd.c
32index def96292e0..20bb896c4a 100644
33--- a/block/rbd.c
34+++ b/block/rbd.c
35@@ -1279,11 +1279,11 @@ static int qemu_rbd_diff_iterate_cb(uint64_t offs, size_t len,
36 RBDDiffIterateReq *req = opaque;
37
38 assert(req->offs + req->bytes <= offs);
39- /*
40- * we do not diff against a snapshot so we should never receive a callback
41- * for a hole.
42- */
43- assert(exists);
44+
45+ /* treat a hole like an unallocated area and bail out */
46+ if (!exists) {
47+ return 0;
48+ }
49
50 if (!req->exists && offs > req->offs) {
51 /*
52--
532.35.1
54
diff --git a/debian/patches/ubuntu/lp-1968258-block-rbd-workaround-for-ceph-issue-53784.patch b/debian/patches/ubuntu/lp-1968258-block-rbd-workaround-for-ceph-issue-53784.patch
0new file mode 10064455new file mode 100644
index 0000000..5ee662e
--- /dev/null
+++ b/debian/patches/ubuntu/lp-1968258-block-rbd-workaround-for-ceph-issue-53784.patch
@@ -0,0 +1,98 @@
1From fc176116cdea816ceb8dd969080b2b95f58edbc0 Mon Sep 17 00:00:00 2001
2From: Peter Lieven <pl@kamp.de>
3Date: Thu, 13 Jan 2022 15:44:26 +0100
4Subject: [PATCH] block/rbd: workaround for ceph issue #53784
5
6librbd had a bug until early 2022 that affected all versions of ceph that
7supported fast-diff. This bug results in reporting of incorrect offsets
8if the offset parameter to rbd_diff_iterate2 is not object aligned.
9
10This patch works around this bug for pre Quincy versions of librbd.
11
12Fixes: 0347a8fd4c3faaedf119be04c197804be40a384b
13Cc: qemu-stable@nongnu.org
14Signed-off-by: Peter Lieven <pl@kamp.de>
15Message-Id: <20220113144426.4036493-3-pl@kamp.de>
16Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
17Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
18Tested-by: Stefano Garzarella <sgarzare@redhat.com>
19Signed-off-by: Kevin Wolf <kwolf@redhat.com>
20
21Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=fc176116cdea816ceb8dd969080b
22Bug-Ubuntu: https://bugs.launchpad.net/bugs/1968258
23Last-Update: 2022-04-08
24
25---
26 block/rbd.c | 42 ++++++++++++++++++++++++++++++++++++++++--
27 1 file changed, 40 insertions(+), 2 deletions(-)
28
29diff --git a/block/rbd.c b/block/rbd.c
30index 20bb896c4a..8f183eba2a 100644
31--- a/block/rbd.c
32+++ b/block/rbd.c
33@@ -1320,6 +1320,7 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
34 int status, r;
35 RBDDiffIterateReq req = { .offs = offset };
36 uint64_t features, flags;
37+ uint64_t head = 0;
38
39 assert(offset + bytes <= s->image_size);
40
41@@ -1347,7 +1348,43 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
42 return status;
43 }
44
45- r = rbd_diff_iterate2(s->image, NULL, offset, bytes, true, true,
46+#if LIBRBD_VERSION_CODE < LIBRBD_VERSION(1, 17, 0)
47+ /*
48+ * librbd had a bug until early 2022 that affected all versions of ceph that
49+ * supported fast-diff. This bug results in reporting of incorrect offsets
50+ * if the offset parameter to rbd_diff_iterate2 is not object aligned.
51+ * Work around this bug by rounding down the offset to object boundaries.
52+ * This is OK because we call rbd_diff_iterate2 with whole_object = true.
53+ * However, this workaround only works for non cloned images with default
54+ * striping.
55+ *
56+ * See: https://tracker.ceph.com/issues/53784
57+ */
58+
59+ /* check if RBD image has non-default striping enabled */
60+ if (features & RBD_FEATURE_STRIPINGV2) {
61+ return status;
62+ }
63+
64+#pragma GCC diagnostic push
65+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
66+ /*
67+ * check if RBD image is a clone (= has a parent).
68+ *
69+ * rbd_get_parent_info is deprecated from Nautilus onwards, but the
70+ * replacement rbd_get_parent is not present in Luminous and Mimic.
71+ */
72+ if (rbd_get_parent_info(s->image, NULL, 0, NULL, 0, NULL, 0) != -ENOENT) {
73+ return status;
74+ }
75+#pragma GCC diagnostic pop
76+
77+ head = req.offs & (s->object_size - 1);
78+ req.offs -= head;
79+ bytes += head;
80+#endif
81+
82+ r = rbd_diff_iterate2(s->image, NULL, req.offs, bytes, true, true,
83 qemu_rbd_diff_iterate_cb, &req);
84 if (r < 0 && r != QEMU_RBD_EXIT_DIFF_ITERATE2) {
85 return status;
86@@ -1366,7 +1403,8 @@ static int coroutine_fn qemu_rbd_co_block_status(BlockDriverState *bs,
87 status = BDRV_BLOCK_ZERO | BDRV_BLOCK_OFFSET_VALID;
88 }
89
90- *pnum = req.bytes;
91+ assert(req.bytes > head);
92+ *pnum = req.bytes - head;
93 return status;
94 }
95
96--
972.35.1
98

Subscribers

People subscribed via source and target branches