]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix fault_range for _do_write_v2 61882/head
authorChunmei Liu <chunmei.liu@ibm.com>
Tue, 18 Feb 2025 21:01:36 +0000 (21:01 +0000)
committerChunmei Liu <chunmei.liu@ibm.com>
Thu, 20 Feb 2025 18:02:06 +0000 (18:02 +0000)
do_write_v2 insert extentmap by aligned offset, if fault_range use
original offet~length, may not cover the proper extentmap range.

Signed-off-by: Chunmei Liu <chunmei.liu@ibm.com>
src/os/bluestore/BlueStore.cc

index ba1e0aa4c25d7220716ba1e2460d3b39088882e3..400bc1b7f4c7817cb9232aa3fedeffb95ef679df 100644 (file)
@@ -17532,7 +17532,9 @@ int BlueStore::_do_write_v2(
   if (bl.length() != length) {
     bl.splice(length, bl.length() - length);
   }
-  o->extent_map.fault_range(db, offset, length);
+  uint64_t start = p2align(offset, min_alloc_size);
+  uint64_t end = p2roundup(offset + length, min_alloc_size);
+  o->extent_map.fault_range(db, start, end - start);
   BlueStore::Writer wr(this, txc, &wctx, o);
   wr.do_write(offset, bl);
   return r;