]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: create page aligned bufferptr in copy ctor of CachedExtent 54097/head
authorZhang Song <zhangsong02@qianxin.com>
Tue, 19 Sep 2023 06:08:51 +0000 (14:08 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 19 Oct 2023 07:17:05 +0000 (07:17 +0000)
Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
(cherry picked from commit 07577e3bc14423acec391a85ee79ddc6b1f269a1)

src/crimson/os/seastore/cached_extent.h

index 26efa453dd75e0b74b0a5a759ccd221b6f2bef50..047bc3b12d0d597d60913a9a50cdd2b090b65d3c 100644 (file)
@@ -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<ceph::bufferptr>
-          (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