From: Yan, Zheng Date: Mon, 27 Apr 2020 06:48:33 +0000 (+0800) Subject: mds: take xlock in the order requests start locking X-Git-Tag: v14.2.10~8^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=51186a53445f8611eac5dc4f747ec13b9db94baf;p=ceph.git 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" (cherry picked from commit 2e11a35d5b06312e0b2d0aecd83e8eb882ddf719) --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index cf3c7aa5e387..284cb254e5d4 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1612,7 +1612,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);