Skip to content

Commit e656af9

Browse files
committed
Merge PR ceph#58861 into main
* refs/pull/58861/head: mds: only authpin on wrlock when not a locallock Reviewed-by: Venky Shankar <[email protected]> Reviewed-by: Mark Nelson <[email protected]>
2 parents cfa3a1f + 6bfa726 commit e656af9

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/mds/Locker.cc

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -344,21 +344,23 @@ bool Locker::acquire_locks(const MDRequestRef& mdr,
344344
}
345345
} else if (p.is_wrlock()) {
346346
dout(20) << " must wrlock " << *lock << " " << *object << dendl;
347-
client_t _client = p.is_state_pin() ? lock->get_excl_client() : client;
348-
if (object->is_auth()) {
349-
mustpin.insert(object);
350-
} else if (!object->is_auth() &&
351-
!lock->can_wrlock(_client) && // we might have to request a scatter
352-
!mdr->is_peer()) { // if we are peer (remote_wrlock), the leader already authpinned
353-
dout(15) << " will also auth_pin " << *object
354-
<< " in case we need to request a scatter" << dendl;
355-
mustpin.insert(object);
356-
}
357-
if (need_quiescelock && (lock->get_cap_shift() > 0)) {
358-
dout(20) << "need shared quiesce lock for " << p << " on " << SimpleLock::get_lock_type_name(t) << " of " << object << dendl;
359-
need_quiescelock = false;
360-
CInode *in = static_cast<CInode*>(object);
361-
lov.add_wrlock(&in->quiescelock, i + 1);
347+
if (!lock->is_locallock()) {
348+
client_t _client = p.is_state_pin() ? lock->get_excl_client() : client;
349+
if (object->is_auth()) {
350+
mustpin.insert(object);
351+
} else if (!object->is_auth() &&
352+
!lock->can_wrlock(_client) && // we might have to request a scatter
353+
!mdr->is_peer()) { // if we are peer (remote_wrlock), the leader already authpinned
354+
dout(15) << " will also auth_pin " << *object
355+
<< " in case we need to request a scatter" << dendl;
356+
mustpin.insert(object);
357+
}
358+
if (need_quiescelock && (lock->get_cap_shift() > 0)) {
359+
dout(20) << "need shared quiesce lock for " << p << " on " << SimpleLock::get_lock_type_name(t) << " of " << object << dendl;
360+
need_quiescelock = false;
361+
CInode *in = static_cast<CInode*>(object);
362+
lov.add_wrlock(&in->quiescelock, i + 1);
363+
}
362364
}
363365
} else if (p.is_remote_wrlock()) {
364366
dout(20) << " must remote_wrlock on mds." << p.wrlock_target << " "
@@ -372,6 +374,7 @@ bool Locker::acquire_locks(const MDRequestRef& mdr,
372374
}
373375
} else if (p.is_rdlock()) {
374376
dout(20) << " must rdlock " << *lock << " " << *object << dendl;
377+
ceph_assert(!lock->is_locallock());
375378
if (object->is_auth()) {
376379
mustpin.insert(object);
377380
} else if (!object->is_auth() &&

0 commit comments

Comments
 (0)