]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Revert "mds: Fix straydn race between unlink/rename linkmerge"
authorVenky Shankar <vshankar@redhat.com>
Tue, 18 Mar 2025 08:57:18 +0000 (08:57 +0000)
committerVenky Shankar <vshankar@redhat.com>
Wed, 28 May 2025 04:31:59 +0000 (10:01 +0530)
This reverts commit f264f11f44d6355452dadc2a20efddc012c531e3.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 2d0a9e45065836ba52970e8663567d2673bc816a)

src/mds/Mutation.h
src/mds/Server.cc

index dd80d1e26f9290e299e655d254ab26510566aed4..1abdd77af9c799c30b51129f6b9d5309e78dd7cc 100644 (file)
@@ -485,9 +485,6 @@ struct MDRequestImpl : public MutationImpl {
   // indicator for vxattr osdmap update
   bool waited_for_osdmap = false;
 
-  // referent straydn
-  bool referent_straydn = false;
-
 protected:
   void _dump(ceph::Formatter *f) const override {
     _dump(f, false);
index 261ae715be9b5bde64b0cb3785aaf13880c1541b..a81d6d09639c5d2e3ac3ab75c871e6b63e400082 100644 (file)
@@ -8527,37 +8527,14 @@ void Server::handle_client_unlink(const MDRequestRef& mdr)
   // -- create stray dentry? --
   CDentry *straydn = NULL;
   if (dnl->is_primary()) {
-    /* Handle race between unlink of secondary hardlink (say hl_file1) and
-     * linkmerge rename, triggered by unlink of primary (say file1) on to
-     * the same secondary hardlink (hl_file1).
-     *           1. unlink hl_file1
-     *           2. prepares straydn for referent inode
-     *           3. wait for the locks
-     *
-     *   unlink file1, triggers linkmerge rename
-     *   rename(hl_file1, primary_stray) ---> referent straydn converted to primary
-     *
-     *           4. On retry, it find itself as primary,
-     *              needs to prepare straydn for primary.
-     *              so clean up the earlier referent straydn
-     */
-    if (mdr->straydn && mdr->referent_straydn) {
-      dout(10) << __func__ << " race, clean up referent straydn " << *mdr->straydn << dendl;
-      mdr->unpin(mdr->straydn);
-      mdr->straydn = nullptr;
-    }
     straydn = prepare_stray_dentry(mdr, dnl->get_inode());
     if (!straydn)
       return;
-    mdr->referent_straydn = false;
     dout(10) << " straydn is " << *straydn << dendl;
   } else if (dnl->is_referent_remote()) {
-    // Above race is not applicable here since a referent can get converted
-    // to primary but not the otherway.
     straydn = prepare_stray_dentry(mdr, dnl->get_referent_inode());
     if (!straydn)
       return;
-    mdr->referent_straydn = true;
     dout(10) << __func__ << " referent straydn is " << *straydn << dendl;
   } else if (mdr->straydn) {
     mdr->unpin(mdr->straydn);
@@ -9420,13 +9397,11 @@ void Server::handle_client_rename(const MDRequestRef& mdr)
     straydn = prepare_stray_dentry(mdr, destdnl->get_inode());
     if (!straydn)
       return;
-    mdr->referent_straydn = false;
     dout(10) << " straydn is " << *straydn << dendl;
   } else if (destdnl->is_referent_remote()) { //both linkmerge and non linkmerge case
     straydn = prepare_stray_dentry(mdr, destdnl->get_referent_inode());
     if (!straydn)
       return;
-    mdr->referent_straydn = true;
     dout(10) << __func__ << (linkmerge ? " linkmerge:yes ": " linkmerge:no ")
              << " referent straydn is " << *straydn << dendl;
   } else if (mdr->straydn) {