From f275b458fb8bfa984e8b553c743c88d63fbf7f7b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 14 May 2009 16:10:27 -0700 Subject: [PATCH] mds: drain wrlocks before going from LOCK->SYNC in file_eval This avoids excessive waits for the journal to flush on lock->sync when a client request holds a wrlock. There's no reason to hurry.. if someone needs it sync we can to the transition then; otherwise, it'll happen when the wrlock is dropped. --- src/mds/Locker.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 0873a10fdc50c..3fae38eefc449 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3078,6 +3078,7 @@ void Locker::file_eval(ScatterLock *lock, bool *need_issue) // * -> sync? else if (lock->get_state() != LOCK_SYNC && + !lock->is_wrlocked() && // drain wrlocks first! !in->filelock.is_waiter_for(SimpleLock::WAIT_WR) && !(wanted & (CEPH_CAP_GWR|CEPH_CAP_GBUFFER)) && !(in->get_state() == LOCK_MIX && -- 2.39.5