]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: move to MIX state if writer wanted and no wanted loner
authorSage Weil <sage.weil@dreamhost.com>
Wed, 13 Jul 2011 00:27:41 +0000 (17:27 -0700)
committerSage Weil <sage@newdream.net>
Wed, 13 Jul 2011 21:57:57 +0000 (14:57 -0700)
We can just look at the target loner here, which also takes any caps wanted
by other replicas on other MDSs into account.  Otherwise we need to
to duplicate the CInode::calc_ideal_loner() logic.

This assumes the loner field is accurate.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mds/Locker.cc

index b82826f11b495174a866864807f619d1f9a7fba4..bfe2fe34244b6d35d469e5a28d4168c7370c70f7 100644 (file)
@@ -3949,7 +3949,7 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue)
           !lock->is_rdlocked() &&
           //!lock->is_waiter_for(SimpleLock::WAIT_WR) &&
           (lock->get_scatter_wanted() ||
-           (in->multiple_nonstale_caps() && (wanted & CEPH_CAP_GWR)))) {
+           (in->get_wanted_loner() < 0 && (wanted & CEPH_CAP_GWR)))) {
     dout(7) << "file_eval stable, bump to mixed " << *lock
            << " on " << *lock->get_parent() << dendl;
     scatter_mix(lock, need_issue);