public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Kefu Chai" <k.chai@proxmox.com>
To: "Kefu Chai" <k.chai@proxmox.com>, <pve-devel@lists.proxmox.com>,
	"Thomas Lamprecht" <t.lamprecht@proxmox.com>
Subject: Re: [pve-devel] [PATCH ceph squid-stable-9] bluefs: fix OSD crash caused by incorrect alignment assertion
Date: Thu, 15 Jan 2026 11:52:48 +0800	[thread overview]
Message-ID: <DFOUWSDKQYZZ.3VMKQ2VJ0CUUV@proxmox.com> (raw)
In-Reply-To: <20260114084754.8803-2-k.chai@proxmox.com>

Hi Thomas, 

could you help review this change as well? it backports the cherry-pick
in upstream's squid branch to our own LTS squid-stable-9 branch.

On Wed Jan 14, 2026 at 4:47 PM CST, Kefu Chai wrote:
> A regression was introduced in PR #62514 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/63753
>
> References:
> - Upstream issue: https://tracker.ceph.com/issues/71534
> - Introduced by: https://github.com/ceph/ceph/pull/62514
>
> Fixes: #7211
>
> Signed-off-by: Kefu Chai <k.chai@proxmox.com>
> ---
>  ...BlueFS-truncate-accept-wierd-alloc_u.patch | 41 +++++++++++++++++++
>  patches/series                                |  1 +
>  2 files changed, 42 insertions(+)
>  create mode 100644 patches/0057-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
>
> diff --git a/patches/0057-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch b/patches/0057-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
> new file mode 100644
> index 00000000000..aa2b961678e
> --- /dev/null
> +++ b/patches/0057-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch
> @@ -0,0 +1,41 @@
> +From 9832d7666439903edd11a20b1c6ae20de66dd9e4 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/71534
> +
> +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 c4557501935..59cae8dcfc7 100644
> +--- a/src/os/bluestore/BlueFS.cc
> ++++ b/src/os/bluestore/BlueFS.cc
> +@@ -3867,10 +3867,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
> +
> diff --git a/patches/series b/patches/series
> index badc33a9969..b56286554fb 100644
> --- a/patches/series
> +++ b/patches/series
> @@ -54,3 +54,4 @@
>  0054-client-prohibit-unprivileged-users-from-setting-sgid.patch
>  0055-pybind-rbd-disable-on_progress-callbacks-to-prevent-.patch
>  0056-mgr-avoid-explicitly-dropping-ref-of-MgrOpRequest.re.patch
> +0057-os-bluestore-In-BlueFS-truncate-accept-wierd-alloc_u.patch



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2026-01-15  3:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14  8:47 Kefu Chai
2026-01-15  3:52 ` Kefu Chai [this message]
2026-01-15  8:23 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DFOUWSDKQYZZ.3VMKQ2VJ0CUUV@proxmox.com \
    --to=k.chai@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal