From 2e11a35d5b06312e0b2d0aecd83e8eb882ddf719 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 27 Apr 2020 14:48:33 +0800 Subject: [PATCH] mds: take xlock in the order requests start locking this avoid assertion in MutaionImpl::finish_locking() Fix: https://tracker.ceph.com/issues/45261 Signed-off-by: "Yan, Zheng" --- src/mds/Locker.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index b811db4870c..b249b787671 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1906,7 +1906,8 @@ bool Locker::xlock_start(SimpleLock *lock, MDRequestRef& mut) if (lock->get_parent()->is_auth()) { // auth while (1) { - if (lock->can_xlock(client) && + if (mut->locking && // started xlock (not preempt other request) + lock->can_xlock(client) && !(lock->get_state() == LOCK_LOCK_XLOCK && // client is not xlocker or in && in->issued_caps_need_gather(lock))) { // xlocker does not hold shared cap lock->set_state(LOCK_XLOCK); -- 2.39.5