Skip to content

Commit

Permalink
mds: take xlock in the order requests start locking
Browse files Browse the repository at this point in the history
this avoid assertion in MutaionImpl::finish_locking()

Fix: https://tracker.ceph.com/issues/45261
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
  • Loading branch information
ukernel committed Apr 27, 2020
1 parent 036c40e commit 2e11a35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mds/Locker.cc
Expand Up @@ -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);
Expand Down

0 comments on commit 2e11a35

Please sign in to comment.