]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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>
Wed, 25 Mar 2026 07:45:18 +0000 (07:45 +0000)
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 8b305b842973dff8959f7be7ff563ef9b3745590..6d1ea61086b4a76ea2a256c1e54ed81f3f385044 100644 (file)
@@ -4117,7 +4117,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) {