]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: prevent trim count from underflowing 18316/head
authorPatrick Donnelly <pdonnell@redhat.com>
Sat, 14 Oct 2017 20:47:53 +0000 (13:47 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 16 Oct 2017 00:04:14 +0000 (17:04 -0700)
Fixes: http://tracker.ceph.com/issues/21807
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 452bdd8b35643ed82d8614efcd4ca22688392eb6)

src/mds/MDCache.cc

index a2510f989819d5a66f07eb7822f4dd0c58faf665..9fc0c25b7ef6971b7a69365a858401660e4c3014 100644 (file)
@@ -6481,8 +6481,8 @@ void MDCache::trim_lru(uint64_t count, map<mds_rank_t, MCacheExpire*> &expiremap
       unexpirables.push_back(dn);
     } else {
       trimmed++;
+      if (count > 0) count--;
     }
-    count--;
   }
 
   for (auto &dn : unexpirables) {