]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: choose MIX state if replica of scatterlock is in MIX state
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 5 May 2014 06:36:16 +0000 (14:36 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Thu, 8 May 2014 03:29:17 +0000 (11:29 +0800)
After ScatterLock::infer_state_from_strong_rejoin() set scatterlock
to LOCK_MIX state, don't change the scatterlock to other state.

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

index 9ca1cf20b287ec284b4f74f8d07d9935a9ca4a8d..2dce5f959649b102fbfd2187c5bd6c072d28c889 100644 (file)
@@ -2454,7 +2454,7 @@ void CInode::choose_lock_state(SimpleLock *lock, int allissued)
   if (is_auth()) {
     if (lock->is_xlocked()) {
       // do nothing here
-    } else {
+    } else if (lock->get_state() != LOCK_MIX) {
       if (issued & CEPH_CAP_GEXCL)
        lock->set_state(LOCK_EXCL);
       else if (issued & CEPH_CAP_GWR)
index 1236c96db8c1a268a64737b3afe7e7f2b6879baf..618f6dfa5624e395623c21d49435a22d56237ee8 100644 (file)
@@ -4593,7 +4593,7 @@ void MDCache::handle_cache_rejoin_strong(MMDSCacheRejoin *strong)
     //  infer state from replica state:
     //   * go to MIX if they might have wrlocks
     //   * go to LOCK if they are LOCK (just bc identify_files_to_recover might start twiddling filelock)
-    in->filelock.infer_state_from_strong_rejoin(is.filelock, true);  // maybe also go to LOCK
+    in->filelock.infer_state_from_strong_rejoin(is.filelock, !in->is_dir());  // maybe also go to LOCK
     in->nestlock.infer_state_from_strong_rejoin(is.nestlock, false);
     in->dirfragtreelock.infer_state_from_strong_rejoin(is.dftlock, false);