]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: clear lock flushed if replica is waiting for AC_LOCKFLUSHED
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 19 Nov 2012 02:43:38 +0000 (10:43 +0800)
committerSage Weil <sage@inktank.com>
Sat, 1 Dec 2012 20:52:22 +0000 (12:52 -0800)
So eval_gather() will not skip calling scatter_writebehind(),
otherwise the replica lock may be in flushing state forever.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Locker.cc

index b67b3ee6a522d955a3fb9d2af6abab7f87903b18..c500be5f457a08de5b53752b167d5b5caa87fc57 100644 (file)
@@ -4404,8 +4404,12 @@ void Locker::handle_file_lock(ScatterLock *lock, MLock *m)
     if (lock->get_state() == LOCK_MIX_LOCK ||
        lock->get_state() == LOCK_MIX_LOCK2 ||
        lock->get_state() == LOCK_MIX_EXCL ||
-       lock->get_state() == LOCK_MIX_TSYN)
+       lock->get_state() == LOCK_MIX_TSYN) {
       lock->decode_locked_state(m->get_data());
+      // replica is waiting for AC_LOCKFLUSHED, eval_gather() should not
+      // delay calling scatter_writebehind().
+      lock->clear_flushed();
+    }
 
     if (lock->is_gathering()) {
       dout(7) << "handle_file_lock " << *in << " from " << from