]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: don't dirty onode if its size is already at desired offset
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 5 Sep 2016 08:42:12 +0000 (16:42 +0800)
committerSage Weil <sage@redhat.com>
Wed, 7 Sep 2016 17:00:19 +0000 (13:00 -0400)
for truncate operation.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index f09b22faeaba3096f1f05a110b2439b1cbe5801e..25f4885540ee0eec094a2f6c76169c59ad4967fa 100644 (file)
@@ -7585,6 +7585,9 @@ int BlueStore::_do_truncate(
           << " 0x" << std::hex << offset << std::dec << dendl;
   _dump_onode(o, 30);
 
+  if (offset == o->onode.size)
+    return 0;
+
   if (offset < o->onode.size) {
     // ensure any wal IO has completed before we truncate off any extents
     // they may touch.