]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: 0-length zero should not change object size
authorSage Weil <sage@redhat.com>
Fri, 6 Oct 2017 20:29:32 +0000 (15:29 -0500)
committerShinobu Kinjo <shinobu@redhat.com>
Sun, 5 Nov 2017 03:39:16 +0000 (12:39 +0900)
Fixes: http://tracker.ceph.com/issues/21712
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit b588eaf2b0fdf06c94104d5a542bd571499f2b85)

src/os/bluestore/BlueStore.cc

index 47eb571b426ca2680eeadaa129b091439019e818..541b000478dadf659715fb762336d96dabb4ba74 100644 (file)
@@ -10568,7 +10568,7 @@ int BlueStore::_do_zero(TransContext *txc,
   o->extent_map.dirty_range(offset, length);
   _wctx_finish(txc, c, o, &wctx);
 
-  if (offset + length > o->onode.size) {
+  if (length > 0 && offset + length > o->onode.size) {
     o->onode.size = offset + length;
     dout(20) << __func__ << " extending size to " << offset + length
             << dendl;