]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Prevent negative local num_bytes sent to peer for backfill reservation
authorDavid Zafman <dzafman@redhat.com>
Sat, 16 Feb 2019 17:37:36 +0000 (09:37 -0800)
committerDavid Zafman <dzafman@redhat.com>
Sun, 17 Feb 2019 02:02:10 +0000 (18:02 -0800)
Fixes: http://tracker.ceph.com/issues/38344
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/PG.cc

index 0cafa2030c5dcbbab14e13d6a869c12da957b076..295d30f47e5bab7e5689b03aef3b04fe8fee76a7 100644 (file)
@@ -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<int64_t>(0, pi.stats.stats.sum.num_bytes);
         pi.stats.stats.clear();
 
        // initialize peer with our purged_snaps.