]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: continue linking if targeti is temporarily located in stray dir 52199/head
authorXiubo Li <xiubli@redhat.com>
Wed, 30 Aug 2023 05:24:01 +0000 (13:24 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 12 Sep 2023 03:10:18 +0000 (11:10 +0800)
If one inode has more than one hardlink and after the primary dentry
is unlinked it will located the inode in the stray dir temporarily,
which is pending reintegration.

Just before the linkmerge/migrate is triggered a link request comes
it will fail with -EXDEV.

Just skip it and continue the linking.

Fixes: https://tracker.ceph.com/issues/56695
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/mds/Server.cc

index 3c73242bf7cea972b3fdddb7c9167fa5a32a45e0..eca54635ff273c6f71f9a97e5dfb42cdf43a20e8 100644 (file)
@@ -7260,7 +7260,9 @@ void Server::handle_client_link(MDRequestRef& mdr)
   SnapRealm *target_realm = target_pin->find_snaprealm();
   if (target_pin != dir->inode &&
       target_realm->get_subvolume_ino() !=
-      dir->inode->find_snaprealm()->get_subvolume_ino()) {
+      dir->inode->find_snaprealm()->get_subvolume_ino() &&
+      /* The inode is temporarily located in the stray dir pending reintegration */
+      !target_pin->is_stray()) {
     dout(7) << "target is in different subvolume, failing..." << dendl;
     respond_to_request(mdr, -CEPHFS_EXDEV);
     return;