diff mbox

[05/12] mds: Fix xlock imports

Message ID 1349168152-13281-5-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Oct. 2, 2012, 8:55 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

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 | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 8584e60..7659b23 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -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);