]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore/bluefs: Add assert if write buffer is not page aligned
authorAdam Kupczyk <akupczyk@ibm.com>
Thu, 27 Nov 2025 08:02:21 +0000 (08:02 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Tue, 3 Feb 2026 11:21:55 +0000 (12:21 +0100)
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 <akupczyk@ibm.com>
src/os/bluestore/BlueFS.cc

index dbc9ce6d784c36b437201391ac5a4a27cb37a971..36fde6d8b06bfcf47bd1bd14e813ef53ce1aa217 100644 (file)
@@ -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<uintptr_t>(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) {