]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Fix xlock imports
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 2 Oct 2012 08:55:45 +0000 (16:55 +0800)
committerSage Weil <sage@inktank.com>
Tue, 2 Oct 2012 18:22:47 +0000 (11:22 -0700)
Xlock imports and capability imports are uncorrelated, we should call
xlock_import() even there is no capability import.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Server.cc

index 8584e60fdd61c57e7ad5c3f81b457d8ddf87f70f..7659b237bc8062a9fc1ed67b709fbe43c3e530e5 100644 (file)
@@ -5838,16 +5838,16 @@ void Server::_rename_apply(MDRequest *mdr, CDentry *srcdn, CDentry *destdn, CDen
       if (mdr->more()->cap_imports.count(destdnl->get_inode())) {
        mds->mdcache->migrator->finish_import_inode_caps(destdnl->get_inode(), srcdn->authority().first, 
                                                         mdr->more()->cap_imports[destdnl->get_inode()]);
-       /* hack: add an auth pin for each xlock we hold. These were
-        * remote xlocks previously but now they're local and
-        * we're going to try and unpin when we xlock_finish. */
-       for (set<SimpleLock *>::iterator i = mdr->xlocks.begin();
-           i !=  mdr->xlocks.end();
-           ++i)
-         if ((*i)->get_parent() == destdnl->get_inode() &&
-             !(*i)->is_locallock())
-           mds->locker->xlock_import(*i, mdr);
       }
+      /* hack: add an auth pin for each xlock we hold. These were
+       * remote xlocks previously but now they're local and
+       * we're going to try and unpin when we xlock_finish. */
+      for (set<SimpleLock *>::iterator i = mdr->xlocks.begin();
+         i !=  mdr->xlocks.end();
+         ++i)
+       if ((*i)->get_parent() == destdnl->get_inode() &&
+           !(*i)->is_locallock())
+         mds->locker->xlock_import(*i, mdr);
       
       // hack: fix auth bit
       in->state_set(CInode::STATE_AUTH);