mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
mds: disallow hardlink across subvolume
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
This commit is contained in:
parent
53348ab67f
commit
55cc3f7d7d
@ -6336,6 +6336,16 @@ void Server::handle_client_link(MDRequestRef& mdr)
|
||||
return;
|
||||
}
|
||||
|
||||
CInode* target_pin = targeti->get_projected_parent_dir()->inode;
|
||||
SnapRealm *target_realm = target_pin->find_snaprealm();
|
||||
if (target_pin != dir->inode &&
|
||||
target_realm->get_subvolume_ino() !=
|
||||
dir->inode->find_snaprealm()->get_subvolume_ino()) {
|
||||
dout(7) << "target is in different subvolume, failing..." << dendl;
|
||||
respond_to_request(mdr, -EXDEV);
|
||||
return;
|
||||
}
|
||||
|
||||
// go!
|
||||
ceph_assert(g_conf()->mds_kill_link_at != 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user