From a9dd5df2fed161ed314ba4244b252e611b84da70 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 30 Aug 2023 12:51:57 +0800 Subject: [PATCH] Revert "mds: wait the linkmerge/migrate to finish after unlink" This reverts commit 48f9a8990b402daa0f0f9109bc4b0087c01b33c6. Fixes: https://tracker.ceph.com/issues/61818 Signed-off-by: Xiubo Li --- src/mds/CInode.h | 3 +-- src/mds/Server.cc | 21 --------------------- src/mds/StrayManager.cc | 11 ----------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 5c7e1ab2e323..979b451742cb 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -398,8 +398,7 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counterinode && target_realm->get_subvolume_ino() != dir->inode->find_snaprealm()->get_subvolume_ino()) { - if (target_pin->is_stray()) { - mds->locker->drop_locks(mdr.get()); - targeti->add_waiter(CInode::WAIT_UNLINK, - new C_MDS_RetryRequest(mdcache, mdr)); - mdlog->flush(); - return; - } dout(7) << "target is in different subvolume, failing..." << dendl; respond_to_request(mdr, -CEPHFS_EXDEV); return; @@ -9223,12 +9216,6 @@ void Server::handle_client_rename(MDRequestRef& mdr) C_MDS_rename_finish *fin = new C_MDS_rename_finish(this, mdr, srcdn, destdn, straydn); journal_and_reply(mdr, srci, destdn, le, fin); - - // trigger to flush mdlog in case reintegrating or migrating the stray dn, - // because the link requests maybe waiting. - if (srcdn->get_dir()->inode->is_stray()) { - mdlog->flush(); - } mds->balancer->maybe_fragment(destdn->get_dir(), false); } @@ -9839,14 +9826,6 @@ void Server::_rename_apply(MDRequestRef& mdr, CDentry *srcdn, CDentry *destdn, C srcdn->get_dir()->unlink_inode(srcdn); - // After the stray dn being unlinked from the corresponding inode in case of - // reintegrate_stray/migrate_stray, just wake up the waitiers. - MDSContext::vec finished; - in->take_waiting(CInode::WAIT_UNLINK, finished); - if (!finished.empty()) { - mds->queue_waiters(finished); - } - // dest if (srcdn_was_remote) { if (!linkmerge) { diff --git a/src/mds/StrayManager.cc b/src/mds/StrayManager.cc index ec63b1d48b81..03ac9a797a7a 100644 --- a/src/mds/StrayManager.cc +++ b/src/mds/StrayManager.cc @@ -280,17 +280,6 @@ void StrayManager::_purge_stray_logged(CDentry *dn, version_t pdv, MutationRef& dir->remove_dentry(dn); } - // Once we are here normally the waiter list are mostly empty - // but in corner case that the clients pass a invalidate ino, - // which maybe under unlinking, the link caller will add the - // request to the waiter list. We need try to wake them up - // anyway. - MDSContext::vec finished; - in->take_waiting(CInode::WAIT_UNLINK, finished); - if (!finished.empty()) { - mds->queue_waiters(finished); - } - // drop inode inodeno_t ino = in->ino(); if (in->is_dirty()) -- 2.47.3