]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make eval_caps safe on non-auth
authorSage Weil <sage@newdream.net>
Wed, 22 Apr 2009 18:36:11 +0000 (11:36 -0700)
committerSage Weil <sage@newdream.net>
Wed, 22 Apr 2009 23:02:11 +0000 (16:02 -0700)
src/mds/Locker.cc

index 2672bd641216a63db3c1024ccd035437f7eee242..3f9a81d566dd9e22037069b64c55c890c47ede6b 100644 (file)
@@ -548,7 +548,7 @@ bool Locker::eval_caps(CInode *in)
   dout(10) << "eval_caps " << *in << dendl;
 
   // choose loner?
-  if (in->get_loner() < 0) {
+  if (in->is_auth() && in->get_loner() < 0) {
     int wanted = in->get_caps_wanted();
     if (((wanted & (CEPH_CAP_GWR|CEPH_CAP_GWRBUFFER|CEPH_CAP_GEXCL)) ||
         (in->inode.is_dir() && !in->has_subtree_root_dirfrag() &&
@@ -561,23 +561,23 @@ bool Locker::eval_caps(CInode *in)
 
   if (!in->filelock.is_stable())
     eval_gather(&in->filelock, false, &need_issue);
-  else
+  else if (in->is_auth())
     eval(&in->filelock, &need_issue);
   if (!in->authlock.is_stable())
     eval_gather(&in->authlock, false, &need_issue);
-  else
+  else if (in->is_auth())
     eval(&in->authlock, &need_issue);
   if (!in->linklock.is_stable())
     eval_gather(&in->linklock, false, &need_issue);
-  else
+  else if (in->is_auth())
     eval(&in->linklock, &need_issue);
   if (!in->xattrlock.is_stable())
     eval_gather(&in->xattrlock, false, &need_issue);
-  else
+  else if (in->is_auth())
     eval(&in->xattrlock, &need_issue);
 
   // drop loner?
-  if (in->get_loner() >= 0) {
+  if (in->is_auth() && in->get_loner() >= 0) {
     if (in->multiple_nonstale_caps() &&
        in->try_drop_loner()) {
       dout(10) << "  dropped loner" << dendl;