From: Yan, Zheng Date: Mon, 5 May 2014 06:36:16 +0000 (+0800) Subject: mds: choose MIX state if replica of scatterlock is in MIX state X-Git-Tag: v0.81~47^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5fa2bae3a5e19fc616e48133c68cf9e265b45d5c;p=ceph.git mds: choose MIX state if replica of scatterlock is in MIX state 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 --- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 9ca1cf20b287..2dce5f959649 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -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) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 1236c96db8c1..618f6dfa5624 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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);