]> 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)
committerSage Weil <sage@redhat.com>
Mon, 22 Jan 2018 15:00:55 +0000 (09:00 -0600)
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 5fe5b98c5dd074980957be21127afc53bb07d029..eecddd3bda4791a766b51fb5cc7c229d910890d1 100644 (file)
@@ -10571,7 +10571,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;