From ee7fa813ef29890557f0b03bd3950d422484215d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 17 May 2011 21:29:33 -0700 Subject: [PATCH] mds: do not shift to EXCL or MIX while rdlocked There was an old change in file_eval() that was allowing us to switch from SYNC to MIX or EXCL while there were rdlocks, which either caused lots of lock thrashing or could (I think) hang things up completely. This was from ea10a672, an ancient fix for something related that appears to have taken out the rdlocked check by accident. In my tests (one writer, one stat-er), this took things from long stalls (up to 20 seconds) to very responsive stats. Yay! Fixes: #791 Signed-off-by: Sage Weil --- src/mds/Locker.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index ed843c22a063b..18ee3e6e3e35d 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3696,7 +3696,7 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue) // * -> excl? else if (lock->get_state() != LOCK_EXCL && - //!lock->is_rdlocked() && + !lock->is_rdlocked() && //!lock->is_waiter_for(SimpleLock::WAIT_WR) && ((wanted & (CEPH_CAP_GWR|CEPH_CAP_GBUFFER)) || (in->inode.is_dir() && !in->has_subtree_root_dirfrag())) && @@ -3708,7 +3708,7 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue) // * -> mixed? else if (lock->get_state() != LOCK_MIX && - //!lock->is_rdlocked() && + !lock->is_rdlocked() && //!lock->is_waiter_for(SimpleLock::WAIT_WR) && (lock->get_scatter_wanted() || (in->multiple_nonstale_caps() && (wanted & CEPH_CAP_GWR)))) { -- 2.39.5