From 0aa18f32e8347c4615505d3c662ca2c118d993fe 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 3c7c19099a61b..faf63106a8cbf 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3693,7 +3693,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())) && @@ -3705,7 +3705,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