]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "mds: wait the linkmerge/migrate to finish after unlink"
authorXiubo Li <xiubli@redhat.com>
Wed, 30 Aug 2023 04:51:57 +0000 (12:51 +0800)
committerXiubo Li <xiubli@redhat.com>
Mon, 18 Sep 2023 02:05:18 +0000 (10:05 +0800)
This reverts commit 48f9a8990b402daa0f0f9109bc4b0087c01b33c6.

Fixes: https://tracker.ceph.com/issues/61818
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit a9dd5df2fed161ed314ba4244b252e611b84da70)

src/mds/CInode.h
src/mds/Server.cc
src/mds/StrayManager.cc

index 6ba4a55940c82dd85f8f61eab555a795bbc5dfa1..0487d4a0762638c9f7f8e0b15271ab607018c94f 100644 (file)
@@ -397,8 +397,7 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counter<CIno
   static const uint64_t WAIT_FROZEN      = (1<<1);
   static const uint64_t WAIT_TRUNC       = (1<<2);
   static const uint64_t WAIT_FLOCK       = (1<<3);
-  static const uint64_t WAIT_UNLINK      = (1<<4);
-
+  
   static const uint64_t WAIT_ANY_MASK  = (uint64_t)(-1);
 
   // misc
index b98d9650146cd416a2dc2ac4e2b101d7bc0e9475..cfd114fd90f5476c25ac8bb757272b706c0fce5d 100644 (file)
@@ -7272,13 +7272,6 @@ void Server::handle_client_link(MDRequestRef& mdr)
   if (target_pin != dir->inode &&
       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;
@@ -9102,12 +9095,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);
 }
 
@@ -9718,14 +9705,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) {
index 1d37c893318d0a29837d9c3fa3f41a2d57c2f22d..1e41776d4b5bd43f9faeb980ae1eb29df45bc61c 100644 (file)
@@ -279,17 +279,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())