]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: drop locks if requiring auth pinning new objects.
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 19 Nov 2012 02:43:42 +0000 (10:43 +0800)
committerSage Weil <sage@inktank.com>
Sat, 1 Dec 2012 20:52:22 +0000 (12:52 -0800)
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>
src/mds/Locker.cc

index c500be5f457a08de5b53752b167d5b5caa87fc57..63f83116fe16f757b035b917eff39ebd38cc4a5d 100644 (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;
       }