]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: fix the oi size mismatch with real object size 21408/head
authorPeng Xie <peng.hse@xtaotech.com>
Fri, 13 Apr 2018 08:08:00 +0000 (16:08 +0800)
committerPeng Xie <peng.hse@xtaotech.com>
Fri, 13 Apr 2018 08:40:23 +0000 (16:40 +0800)
oi (object_info_t) size mismatch with the real object size on the
persistent backend, which was introduced by the old write with
a smaller truncate_seq falsefully modified the oi size.

Fixes: http://tracker.ceph.com/issues/23701
Signed-off-by: Peng Xie peng.hse@xtaotech.com
src/osd/PrimaryLogPG.cc

index a82fb1075449e1d36d26caaf805c64ea1d6fcf56..03fa2b1d7cedd69792ac0f1fe3424714e3644c8c 100644 (file)
@@ -7899,7 +7899,8 @@ void PrimaryLogPG::write_update_size_and_usage(object_stat_sum_t& delta_stats, o
   } else if (length)
     ch.insert(offset, length);
   modified.union_of(ch);
-  if (write_full || offset + length > oi.size) {
+  if (write_full ||
+      (offset + length > oi.size && length)) {
     uint64_t new_size = offset + length;
     delta_stats.num_bytes -= oi.size;
     delta_stats.num_bytes += new_size;