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>
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)
// 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);