From: Peng Xie Date: Fri, 13 Apr 2018 08:08:00 +0000 (+0800) Subject: osd/PrimaryLogPG: fix the oi size mismatch with real object size X-Git-Tag: v13.1.0~154^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4a34f11697ee7169ae0be77ae99dd64647637ddc;p=ceph-ci.git osd/PrimaryLogPG: fix the oi size mismatch with real object size 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 --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index a82fb107544..03fa2b1d7ce 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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;