mds: drop locks if requiring auth pinning new objects.

Locker::acquire_locks() skip auth pinning replica object if we only
request a rdlock and the lock is read-lockable. To get all locks,
we may call Locker::acquire_locks() several times, locks in replca
objects may become not read-lockable between calls. So it is
possible we need auth pin new objects after already take some locks.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
This commit is contained in:
Yan, Zheng 2012-11-19 10:43:42 +08:00 committed by Sage Weil
parent 9bfe540c65
commit 4cd8ea927e

View File

@ -286,11 +286,12 @@ bool Locker::acquire_locks(MDRequest *mdr,
continue;
if (!object->is_auth()) {
if (!mdr->locks.empty())
mds->locker->drop_locks(mdr);
if (object->is_ambiguous_auth()) {
// wait
dout(10) << " ambiguous auth, waiting to authpin " << *object << dendl;
object->add_waiter(MDSCacheObject::WAIT_SINGLEAUTH, new C_MDS_RetryRequest(mdcache, mdr));
mds->locker->drop_locks(mdr);
mdr->drop_local_auth_pins();
return false;
}