mirror of
https://github.com/ceph/ceph
synced 2024-12-26 21:43:10 +00:00
Merge PR #52631 into main
* refs/pull/52631/head: mds: add debug logs to monitor ceph.dir.subvolume management mds: dump subvolume flag for inode Reviewed-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
commit
096e82c19b
@ -5164,6 +5164,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 *****/
|
||||
|
@ -6151,6 +6151,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;
|
||||
}
|
||||
@ -6165,10 +6169,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();
|
||||
|
Loading…
Reference in New Issue
Block a user