]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix do_write_v2 extentmap compress issue 61762/head
authorchunmei liu <chunmei.liu@ibm.com>
Tue, 11 Feb 2025 22:26:34 +0000 (14:26 -0800)
committerchunmei liu <chunmei.liu@ibm.com>
Tue, 11 Feb 2025 22:26:34 +0000 (14:26 -0800)
do_write_v2 insert extentmap by aligned offset which is adjusted in
writer.do_write, if use original offset will cause extentmap can't do
compress.

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

index 8f1d995fa8db8ca0e58b97b70876b1b747b90e77..25a9e8d5ac63194f2a83a3467e7dab8a4059e33b 100644 (file)
@@ -17521,9 +17521,6 @@ int BlueStore::_do_write_v2(
   o->extent_map.fault_range(db, offset, length);
   BlueStore::Writer wr(this, txc, &wctx, o);
   wr.do_write(offset, bl);
-  o->extent_map.compress_extent_map(offset, length);
-  o->extent_map.dirty_range(offset, length);
-  o->extent_map.maybe_reshard(offset, offset + length);
   return r;
 }
 
index 41bae8d9cef874cd89194d284c5802faeaf2c86e..78f3c9b7d84b96245dc089e29b96ca3e0c59276f 100644 (file)
@@ -1376,6 +1376,9 @@ void BlueStore::Writer::do_write(
   _collect_released_allocated();
   // update statfs
   txc->statfs_delta += statfs_delta;
+  onode->extent_map.compress_extent_map(location, data_end - location);
+  onode->extent_map.dirty_range(location, data_end-location);
+  onode->extent_map.maybe_reshard(location, data_end);
   dout(25) << "result: " << std::endl << onode->print(pp_mode) << dendl;
 }