From: Adam Kupczyk Date: Thu, 27 Nov 2025 08:02:21 +0000 (+0000) Subject: os/bluestore/bluefs: Add assert if write buffer is not page aligned X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9b66d522f807f91ba3776e717300d587d7cb6ecf;p=ceph-ci.git os/bluestore/bluefs: Add assert if write buffer is not page aligned Make sure write buffer is page aligned. Its a check step before implementing fix that makes buffer always page aligned. Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index dbc9ce6d784..36fde6d8b06 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -4099,7 +4099,10 @@ void BlueFS::append_try_flush(FileWriter *h, const char* buf, size_t len)/*_WF_L { std::unique_lock hl(h->lock); if (h->file->envelope_mode() && h->get_buffer_length() == 0) { + uint32_t pos1 = h->get_effective_write_pos(); h->envelope_head_filler = h->append_hole(File::envelope_t::head_size()); + uint32_t pos2 = reinterpret_cast(h->envelope_head_filler.c_str()); + ceph_assert(p2aligned(pos1 ^ pos2, CEPH_PAGE_SIZE)); } size_t max_size = 1ull << 30; // cap to 1GB while (len > 0) {