]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix can_authpin assert on post-fragment commit
authorSage Weil <sage@newdream.net>
Wed, 5 Jan 2011 20:49:58 +0000 (12:49 -0800)
committerSage Weil <sage@newdream.net>
Thu, 6 Jan 2011 00:48:06 +0000 (16:48 -0800)
We wan to ignore the authpinnability check here; we already have the
(old) frag frozen, so no worries about starvation and retaking an auth_pin.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/CDir.cc
src/mds/CDir.h
src/mds/MDCache.cc

index 30e65f9fd796d49171161f171a1b300afcd69433..d146c67b60e12808e13b2121000e648ae57b21fc 100644 (file)
@@ -1498,7 +1498,7 @@ void CDir::_fetched(bufferlist &bl, const string& want_dn)
  * @param want - min version i want committed
  * @param c - callback for completion
  */
-void CDir::commit(version_t want, Context *c)
+void CDir::commit(version_t want, Context *c, bool ignore_authpinnability)
 {
   dout(10) << "commit want " << want << " on " << *this << dendl;
   if (want == 0) want = get_version();
@@ -1507,7 +1507,7 @@ void CDir::commit(version_t want, Context *c)
   assert(want <= get_version() || get_version() == 0);    // can't commit the future
   assert(want > committed_version); // the caller is stupid
   assert(is_auth());
-  assert(can_auth_pin());
+  assert(ignore_authpinnability || can_auth_pin());
 
   // note: queue up a noop if necessary, so that we always
   // get an auth_pin.
index ec829c83754e719f364c1f05e357910d7e1c51d3..33e8c0f28b861689e8bb4e4fe5bd6d725d761015 100644 (file)
@@ -471,7 +471,7 @@ private:
   map<version_t, list<Context*> > waiting_for_commit;
 
   void commit_to(version_t want);
-  void commit(version_t want, Context *c);
+  void commit(version_t want, Context *c, bool ignore_authpinnability=false);
   void _commit(version_t want);
   void _commit_full(ObjectOperation& m, const set<snapid_t> *snaps);
   void _commit_partial(ObjectOperation& m, const set<snapid_t> *snaps);
index 94e509d9e061aa1477e7dba4e440e46f127366ae..88fb8f39ce37399eb92c12e3f9ff14255a76d15d 100644 (file)
@@ -9090,7 +9090,7 @@ void MDCache::fragment_frozen(list<CDir*>& dirs, frag_t basefrag, int bits)
     CDir *dir = *p;
     dout(10) << " result frag " << *dir << dendl;
     dir->state_set(CDir::STATE_FRAGMENTING);
-    dir->commit(0, gather->new_sub());
+    dir->commit(0, gather->new_sub(), true);  // ignore authpinnability
     dir->_freeze_dir();
   }  
 }