diff mbox

[4/4] mds: Allow evaluating locks in replica object.

Message ID 1351168012-4981-4-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Oct. 25, 2012, 12:26 p.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

We should allow Locker::try_eval(MDSCacheObject *, int) to evaluate
locks in replica objects. Otherwise the locks in replica objects
may stuck on unstable states forever.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/Locker.cc | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
index a03789f..2c840a9 100644
--- a/src/mds/Locker.cc
+++ b/src/mds/Locker.cc
@@ -834,12 +834,7 @@  void Locker::try_eval(MDSCacheObject *p, int mask)
     return;
   }
 
-  if (!p->is_auth()) {
-    dout(7) << "try_eval not auth for " << *p << dendl;
-    return;
-  }
-
-  if (!p->can_auth_pin()) {
+  if (p->is_auth() && !p->can_auth_pin()) {
     dout(7) << "try_eval can't auth_pin, waiting on " << *p << dendl;
     p->add_waiter(MDSCacheObject::WAIT_UNFREEZE, new C_Locker_Eval(this, p, mask));
     return;
@@ -847,9 +842,11 @@  void Locker::try_eval(MDSCacheObject *p, int mask)
 
   if (mask & CEPH_LOCK_DN) {
     assert(mask == CEPH_LOCK_DN);
-    bool need_issue = false;  // ignore this, no caps on dentries
-    CDentry *dn = (CDentry *)p;
-    simple_eval(&dn->lock, &need_issue);
+    if (p->is_auth()) {
+      bool need_issue = false;  // ignore this, no caps on dentries
+      CDentry *dn = (CDentry *)p;
+      simple_eval(&dn->lock, &need_issue);
+    }
   } else {
     CInode *in = (CInode *)p;
     eval(in, mask);