From: myoungwon oh Date: Sat, 2 Dec 2017 12:41:57 +0000 (+0900) Subject: osd: set dirty flag if chunks are overwritten X-Git-Tag: v13.0.2~629^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=437bb83c8b31c584033177e9cc0bb610fec46920;p=ceph.git osd: set dirty flag if chunks are overwritten Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 48bf42eb4cf9..0f57703eadd7 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -7627,6 +7627,15 @@ void PrimaryLogPG::write_update_size_and_usage(object_stat_sum_t& delta_stats, o } delta_stats.num_bytes += oi.extents.size(); } + + if (oi.has_manifest() && oi.manifest.is_chunked()) { + for (auto &p : oi.manifest.chunk_map) { + if ((p.first <= offset && p.first + p.second.length > offset) || + (p.first > offset && p.first <= offset + length)) { + p.second.flags = chunk_info_t::FLAG_DIRTY; + } + } + } delta_stats.num_wr++; delta_stats.num_wr_kb += SHIFT_ROUND_UP(length, 10); }