]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix missing.rm()
authorSage Weil <sage@newdream.net>
Thu, 10 Mar 2011 17:54:53 +0000 (09:54 -0800)
committerSage Weil <sage@newdream.net>
Thu, 10 Mar 2011 17:54:53 +0000 (09:54 -0800)
The version specifies which version of the object no longer should be
missing.  We should thus remove it from the missing set if we needed
anything less than OR EQUAL to that version.  (If we are missing something
newer, then missing.rm() is a no-op.)

Make the argument name less weird while we're at it.

Reported-by: Henry Chang <henry.cy.chang@gmail.com>
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/PG.cc
src/osd/PG.h

index 332bd475b1e305e76483cf77c27e3e99c2901eb3..d3f09a201845b1c8108ae3290d599317be08cef4 100644 (file)
@@ -3600,9 +3600,9 @@ void PG::Missing::add(const sobject_t& oid, eversion_t need, eversion_t have)
   rmissing[need] = oid;
 }
 
-void PG::Missing::rm(const sobject_t& oid, eversion_t when)
+void PG::Missing::rm(const sobject_t& oid, eversion_t v)
 {
-  if (missing.count(oid) && missing[oid].need < when) {
+  if (missing.count(oid) && missing[oid].need <= v) {
     rmissing.erase(missing[oid].need);
     missing.erase(oid);
   }
index 727ee9dd0880a9ad9905174e578dfdab6a58b8ad..db222b2c3e7a13b8b4ea130dcf70fc77626f0498 100644 (file)
@@ -585,7 +585,7 @@ public:
     void add_event(Log::Entry& e);
     void revise_need(sobject_t oid, eversion_t need);
     void add(const sobject_t& oid, eversion_t need, eversion_t have);
-    void rm(const sobject_t& oid, eversion_t when);
+    void rm(const sobject_t& oid, eversion_t v);
     void got(const sobject_t& oid, eversion_t v);
     void got(const std::map<sobject_t, Missing::item>::iterator &m);