* [pve-devel] [PATCH ceph reef-stable-8] bluefs: fix OSD crash caused by incorrect alignment assertion
@ 2026-01-07 10:41 Kefu Chai
2026-01-14 7:47 ` Kefu Chai
2026-01-14 8:57 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 2 replies; 3+ messages in thread
From: Kefu Chai @ 2026-01-07 10:41 UTC (permalink / raw)
To: pve-devel
A regression was introduced in PR #62174 that added a `ceph_assert()`
statement which incorrectly assumes alloc_unit is always aligned. This
causes OSD crashes when the assertion fails.
This cherry-pick removes the faulty assertion, resolving the crash while
maintaining correct functionality for both aligned and unaligned alloc_unit
values.
Cherry-picked from: https://github.com/ceph/ceph/pull/66056
References:
- Upstream issue: https://tracker.ceph.com/issues/71235
- Introduced by: https://github.com/ceph/ceph/pull/62174
Fixes: #7211
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
---
...BlueFS-truncate-accept-wierd-alloc_u.patch | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 patches/0018-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
diff --git a/patches/0018-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch b/patches/0018-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
new file mode 100644
index 00000000000..b2507924523
--- /dev/null
+++ b/patches/0018-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
@@ -0,0 +1,41 @@
+From 87c90994b2f0c4274208028367cc8f376d0b1d6e Mon Sep 17 00:00:00 2001
+From: Adam Kupczyk <akupczyk@ibm.com>
+Date: Tue, 11 Mar 2025 10:52:15 +0000
+Subject: [PATCH] os/bluestore: In BlueFS::truncate accept wierd alloc_unit
+
+The alignment of extents might not reflect current alloc_unit[bdev].
+It might be caused be either fallback to alternate AU size for SLOW,
+or change of allocation unit in DB or WAL.
+In such cases, truncation just leaves extent untouched.
+
+Fixes: https://tracker.ceph.com/issues/71235
+
+Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
+(cherry picked from commit 0da7a2a58c207b97c9bcf4a1dfcd9d09f0e9b954)
+---
+ src/os/bluestore/BlueFS.cc | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc
+index 3e7955f6433..93dc6e4753a 100644
+--- a/src/os/bluestore/BlueFS.cc
++++ b/src/os/bluestore/BlueFS.cc
+@@ -3736,10 +3736,12 @@ int BlueFS::truncate(FileWriter *h, uint64_t offset)/*_WF_L*/
+ changed_extents = true;
+ ++p;
+ } else {
+- // cut_off > p->length means that we misaligned the extent
+- ceph_assert(cut_off == p->length);
++ // Usually cut_off == p->length.
++ // Case cut_off > p->length means that we misaligned the extent
++ // or alloc size changed in the meantime.
++ // In both cases just leave extent untouched.
+ fnode.allocated = (offset - x_off) + p->length;
+- ++p; // leave extent untouched
++ ++p;
+ }
+ while (p != fnode.extents.end()) {
+ dirty.pending_release[p->bdev].insert(p->offset, p->length);
+--
+2.47.3
+
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [pve-devel] [PATCH ceph reef-stable-8] bluefs: fix OSD crash caused by incorrect alignment assertion
2026-01-07 10:41 [pve-devel] [PATCH ceph reef-stable-8] bluefs: fix OSD crash caused by incorrect alignment assertion Kefu Chai
@ 2026-01-14 7:47 ` Kefu Chai
2026-01-14 8:57 ` [pve-devel] applied: " Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Kefu Chai @ 2026-01-14 7:47 UTC (permalink / raw)
To: Thomas Lamprecht, pve-devel
Hi Thomas,
Could you help review this change at your convenience?
On Wed Jan 7, 2026 at 6:41 PM CST, Kefu Chai wrote:
> A regression was introduced in PR #62174 that added a `ceph_assert()`
> statement which incorrectly assumes alloc_unit is always aligned. This
> causes OSD crashes when the assertion fails.
>
> This cherry-pick removes the faulty assertion, resolving the crash while
> maintaining correct functionality for both aligned and unaligned alloc_unit
> values.
>
> Cherry-picked from: https://github.com/ceph/ceph/pull/66056
>
> References:
> - Upstream issue: https://tracker.ceph.com/issues/71235
> - Introduced by: https://github.com/ceph/ceph/pull/62174
>
> Fixes: #7211
>
> Signed-off-by: Kefu Chai <k.chai@proxmox.com>
> ---
> ...BlueFS-truncate-accept-wierd-alloc_u.patch | 41 +++++++++++++++++++
> 1 file changed, 41 insertions(+)
> create mode 100644 patches/0018-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
>
> diff --git a/patches/0018-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch b/patches/0018-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
> new file mode 100644
> index 00000000000..b2507924523
> --- /dev/null
> +++ b/patches/0018-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
> @@ -0,0 +1,41 @@
> +From 87c90994b2f0c4274208028367cc8f376d0b1d6e Mon Sep 17 00:00:00 2001
> +From: Adam Kupczyk <akupczyk@ibm.com>
> +Date: Tue, 11 Mar 2025 10:52:15 +0000
> +Subject: [PATCH] os/bluestore: In BlueFS::truncate accept wierd alloc_unit
> +
> +The alignment of extents might not reflect current alloc_unit[bdev].
> +It might be caused be either fallback to alternate AU size for SLOW,
> +or change of allocation unit in DB or WAL.
> +In such cases, truncation just leaves extent untouched.
> +
> +Fixes: https://tracker.ceph.com/issues/71235
> +
> +Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
> +(cherry picked from commit 0da7a2a58c207b97c9bcf4a1dfcd9d09f0e9b954)
> +---
> + src/os/bluestore/BlueFS.cc | 8 +++++---
> + 1 file changed, 5 insertions(+), 3 deletions(-)
> +
> +diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc
> +index 3e7955f6433..93dc6e4753a 100644
> +--- a/src/os/bluestore/BlueFS.cc
> ++++ b/src/os/bluestore/BlueFS.cc
> +@@ -3736,10 +3736,12 @@ int BlueFS::truncate(FileWriter *h, uint64_t offset)/*_WF_L*/
> + changed_extents = true;
> + ++p;
> + } else {
> +- // cut_off > p->length means that we misaligned the extent
> +- ceph_assert(cut_off == p->length);
> ++ // Usually cut_off == p->length.
> ++ // Case cut_off > p->length means that we misaligned the extent
> ++ // or alloc size changed in the meantime.
> ++ // In both cases just leave extent untouched.
> + fnode.allocated = (offset - x_off) + p->length;
> +- ++p; // leave extent untouched
> ++ ++p;
> + }
> + while (p != fnode.extents.end()) {
> + dirty.pending_release[p->bdev].insert(p->offset, p->length);
> +--
> +2.47.3
> +
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pve-devel] applied: [PATCH ceph reef-stable-8] bluefs: fix OSD crash caused by incorrect alignment assertion
2026-01-07 10:41 [pve-devel] [PATCH ceph reef-stable-8] bluefs: fix OSD crash caused by incorrect alignment assertion Kefu Chai
2026-01-14 7:47 ` Kefu Chai
@ 2026-01-14 8:57 ` Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2026-01-14 8:57 UTC (permalink / raw)
To: pve-devel, Kefu Chai
On Wed, 07 Jan 2026 18:41:46 +0800, Kefu Chai wrote:
> A regression was introduced in PR #62174 that added a `ceph_assert()`
> statement which incorrectly assumes alloc_unit is always aligned. This
> causes OSD crashes when the assertion fails.
>
> This cherry-pick removes the faulty assertion, resolving the crash while
> maintaining correct functionality for both aligned and unaligned alloc_unit
> values.
>
> [...]
Applied, but ammended the commit to actually add the patch to the quilt series
file, so that it's picked up by the debian build system and fixed the -22 lines
offset of the diff hunk, thanks!
btw. as the final reef release 18.2.8 is being planned (again), and should be
ready soon after the ceph lab is up again after their DC move, do you think
this should be released earlier or could it be fine to wait a bit.
FWIW, we could upload just the ceph-osd packages for now, or are there other
daemons affected by this fix?
[1/1] bluefs: fix OSD crash caused by incorrect alignment assertion
commit: 59bb899d8398575768b6ddd9dc7f4eabd0018533
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-14 8:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-07 10:41 [pve-devel] [PATCH ceph reef-stable-8] bluefs: fix OSD crash caused by incorrect alignment assertion Kefu Chai
2026-01-14 7:47 ` Kefu Chai
2026-01-14 8:57 ` [pve-devel] applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.