From: Sage Weil Date: Wed, 5 Jan 2011 20:49:58 +0000 (-0800) Subject: mds: fix can_authpin assert on post-fragment commit X-Git-Tag: v0.25~377 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=21d49d91f134edd48b4d29feaa59cf10fda2828f;p=ceph.git mds: fix can_authpin assert on post-fragment commit 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 --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 30e65f9fd796..d146c67b60e1 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -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. diff --git a/src/mds/CDir.h b/src/mds/CDir.h index ec829c83754e..33e8c0f28b86 100644 --- a/src/mds/CDir.h +++ b/src/mds/CDir.h @@ -471,7 +471,7 @@ private: map > 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 *snaps); void _commit_partial(ObjectOperation& m, const set *snaps); diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 94e509d9e061..88fb8f39ce37 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -9090,7 +9090,7 @@ void MDCache::fragment_frozen(list& 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(); } }