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>
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;