From: Patrick Donnelly Date: Sun, 3 Mar 2024 03:22:19 +0000 (-0500) Subject: mds: print lock cache during invalidation X-Git-Tag: testing/wip-root-testing-20240411.174241~89^2~14 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=36d314c065bf2640195127175c18fc5e9f02e513;p=ceph-ci.git mds: print lock cache during invalidation Signed-off-by: Patrick Donnelly (cherry picked from commit d86a5c2ab76b740da235aeb1f5a994a84bb3515f) --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 6c528893728..91547a82152 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -895,6 +895,8 @@ public: void Locker::put_lock_cache(MDLockCache* lock_cache) { + dout(20) << __func__ << ": " << *lock_cache << dendl; + ceph_assert(lock_cache->ref > 0); if (--lock_cache->ref > 0) return; @@ -928,6 +930,8 @@ int Locker::get_cap_bit_for_lock_cache(int op) void Locker::invalidate_lock_cache(MDLockCache *lock_cache) { + dout(15) << __func__ << ": " << *lock_cache << dendl; + ceph_assert(lock_cache->item_cap_lock_cache.is_on_list()); if (lock_cache->invalidating) { ceph_assert(!lock_cache->client_cap); diff --git a/src/mds/Mutation.cc b/src/mds/Mutation.cc index ecc455de08d..6ff87183914 100644 --- a/src/mds/Mutation.cc +++ b/src/mds/Mutation.cc @@ -624,3 +624,18 @@ void MDLockCache::detach_dirfrags() } items_dir.reset(); } + +void MDLockCache::print(std::ostream& out) const { + out << "MDLockCache(o=" << ceph_mds_op_name(opcode) + << " diri=" << diri->ino(); + if (client_cap) { + out << " c=" << client_cap->get_client(); + } else { + out << " c=(nil)"; + } + out << " r=" << ref; + if (invalidating) { + out << " invalidating"; + } + out << ")"; +} diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h index 6a11144362e..7f985651e37 100644 --- a/src/mds/Mutation.h +++ b/src/mds/Mutation.h @@ -538,6 +538,7 @@ struct MDLockCache : public MutationImpl { return dir_layout; } + void print(std::ostream& out) const; void attach_locks(); void attach_dirfrags(std::vector&& dfv); void detach_locks();