]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: drain wrlocks before going from LOCK->SYNC in file_eval
authorSage Weil <sage@newdream.net>
Thu, 14 May 2009 23:10:27 +0000 (16:10 -0700)
committerSage Weil <sage@newdream.net>
Thu, 14 May 2009 23:10:27 +0000 (16:10 -0700)
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

index 0873a10fdc50c4ef6afd070e0402dd927662b1a5..3fae38eefc4490ef4bf874e053e445893e8885c2 100644 (file)
@@ -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 &&