From 9106781617081bf9fe556735c093a4d767ccd1ad Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Wed, 2 Aug 2023 14:21:05 +0530 Subject: [PATCH 1/2] mds: dump subvolume flag for inode Fixes: https://tracker.ceph.com/issues/61958 Signed-off-by: Milind Changire --- src/mds/CInode.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index e6cd03442bb..691b1d5265c 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -5165,6 +5165,11 @@ void CInode::dump(Formatter *f, int flags) const } f->close_section(); } + + auto realm = find_snaprealm(); + inodeno_t subvol_ino = realm->get_subvolume_ino(); + bool is_subvol = (subvol_ino && subvol_ino == ino()); + f->dump_bool("is_subvolume", is_subvol); } /****** Scrub Stuff *****/ From b18e6478d160f04134f682304e15a918f13915d6 Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Wed, 2 Aug 2023 14:23:18 +0530 Subject: [PATCH 2/2] mds: add debug logs to monitor ceph.dir.subvolume management Signed-off-by: Milind Changire --- src/mds/Server.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 6d91d5fcda2..4e6b5f2ff92 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -6192,6 +6192,10 @@ void Server::handle_set_vxattr(MDRequestRef& mdr, CInode *cur) inodeno_t subvol_ino = realm->get_subvolume_ino(); // can't create subvolume inside another subvolume if (subvol_ino && subvol_ino != cur->ino()) { + dout(20) << "subvol ino changed between rdlock release and xlock " + << "policylock; subvol_ino: " << subvol_ino << ", " + << "cur->ino: " << cur->ino() + << dendl; respond_to_request(mdr, -CEPHFS_EINVAL); return; } @@ -6206,10 +6210,13 @@ void Server::handle_set_vxattr(MDRequestRef& mdr, CInode *cur) auto pi = cur->project_inode(mdr, false, true); if (!srnode) pi.snapnode->created = pi.snapnode->seq = realm->get_newest_seq(); - if (val) + if (val) { + dout(20) << "marking subvolume for ino: " << cur->ino() << dendl; pi.snapnode->mark_subvolume(); - else + } else { + dout(20) << "clearing subvolume for ino: " << cur->ino() << dendl; pi.snapnode->clear_subvolume(); + } mdr->no_early_reply = true; pip = pi.inode.get();