]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore: create page aligned bufferptr in copy ctor of CachedExtent
authorZhang Song <zhangsong02@qianxin.com>
Tue, 19 Sep 2023 06:08:51 +0000 (14:08 +0800)
committerZhang Song <zhangsong02@qianxin.com>
Wed, 20 Sep 2023 03:38:24 +0000 (11:38 +0800)
Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
src/crimson/os/seastore/cached_extent.h

index 497d7dcfcdc532d508a89e3d336eaa160f1d641e..9615d0257e4bf89a2bb4f05aa92f3b3fe6284cc7 100644 (file)
@@ -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<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