]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: only update onode sizes when necessary 57088/head
authorXuehan Xu <xuxuehan@qianxin.com>
Thu, 25 Apr 2024 06:24:47 +0000 (14:24 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Thu, 25 Apr 2024 06:30:20 +0000 (14:30 +0800)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/seastore.cc

index 4a191e25bc59ba602d59ed11f49156adbd7e6d1b..39d7e7ec2314427511c3ea72c5d262831469aa55 100644 (file)
@@ -1653,8 +1653,8 @@ SeaStore::Shard::_write(
 {
   LOG_PREFIX(SeaStore::_write);
   DEBUGT("onode={} {}~{}", *ctx.transaction, *onode, offset, len);
-  {
-    const auto &object_size = onode->get_layout().size;
+  const auto &object_size = onode->get_layout().size;
+  if (offset + len > object_size) {
     onode->update_onode_size(
       *ctx.transaction,
       std::max<uint64_t>(offset + len, object_size));