]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not shift to EXCL or MIX while rdlocked
authorSage Weil <sage.weil@dreamhost.com>
Wed, 18 May 2011 04:29:33 +0000 (21:29 -0700)
committerSage Weil <sage@newdream.net>
Wed, 25 May 2011 16:38:06 +0000 (09:38 -0700)
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 <sage.weil@dreamhost.com>
src/mds/Locker.cc

index 3c7c19099a61bfdbe6bbbb2a7e481f852f084b75..faf63106a8cbf72f8c1f318a50bb2fb7e4f8ff80 100644 (file)
@@ -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)))) {