From 462cee6fb35e90352ad33c21e8662730be4af64b Mon Sep 17 00:00:00 2001 From: Zhang Song Date: Tue, 19 Sep 2023 14:08:51 +0800 Subject: [PATCH] crimson/os/seastore: create page aligned bufferptr in copy ctor of CachedExtent Signed-off-by: Zhang Song (cherry picked from commit 07577e3bc14423acec391a85ee79ddc6b1f269a1) --- src/crimson/os/seastore/cached_extent.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 26efa453dd7..047bc3b12d0 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -706,9 +706,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 -- 2.39.5