From: David Zafman Date: Sat, 16 Feb 2019 17:37:36 +0000 (-0800) Subject: osd: Prevent negative local num_bytes sent to peer for backfill reservation X-Git-Tag: v14.1.0~35^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=af5c747a808d1c6cf5c4e7f87096e53735a29a4a;p=ceph.git osd: Prevent negative local num_bytes sent to peer for backfill reservation Fixes: http://tracker.ceph.com/issues/38344 Signed-off-by: David Zafman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 0cafa2030c5..295d30f47e5 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2003,8 +2003,8 @@ void PG::activate(ObjectStore::Transaction& t, pi.last_interval_started = info.last_interval_started; pi.history = info.history; pi.hit_set = info.hit_set; - // Save num_bytes for reservation request - peer_bytes[peer] = pi.stats.stats.sum.num_bytes; + // Save num_bytes for reservation request, can't be negative + peer_bytes[peer] = std::max(0, pi.stats.stats.sum.num_bytes); pi.stats.stats.clear(); // initialize peer with our purged_snaps.