From: Sage Weil Date: Wed, 22 Apr 2009 18:36:11 +0000 (-0700) Subject: mds: make eval_caps safe on non-auth X-Git-Tag: v0.7.3~72 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d52741fd0f9bb16e131e454feaee715c76f02ab;p=ceph.git mds: make eval_caps safe on non-auth --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 2672bd64121..3f9a81d566d 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -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;