From: Zhang Song Date: Tue, 19 Sep 2023 06:08:51 +0000 (+0800) Subject: crimson/os/seastore: create page aligned bufferptr in copy ctor of CachedExtent X-Git-Tag: v19.0.0~448^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F53501%2Fhead;p=ceph.git crimson/os/seastore: create page aligned bufferptr in copy ctor of CachedExtent Signed-off-by: Zhang Song --- diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 497d7dcfcdc5..9615d0257e4b 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -707,9 +707,10 @@ protected: length(other.get_length()), version(other.version), poffset(other.poffset) { + assert((length % CEPH_PAGE_SIZE) == 0); if (other.is_fully_loaded()) { - ptr = std::make_optional - (other.ptr->c_str(), other.ptr->length()); + ptr.emplace(buffer::create_page_aligned(length)); + other.ptr->copy_out(0, length, ptr->c_str()); } else { // the extent must be fully loaded before CoW assert(length == 0); // in case of root