diff mbox

[24/29] mds: rdlock prepended dest trace when handling rename

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

Commit Message

Yan, Zheng Jan. 4, 2013, 9:02 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

rdlock prepended dest trace to prevent them from being xlocked by
someone else.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/Server.cc | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 8d05a37..119af98 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -5228,6 +5228,7 @@  void Server::handle_client_rename(MDRequest *mdr)
       while (destbase != srcbase) {
 	desttrace.insert(desttrace.begin(),
 			 destbase->get_projected_parent_dn());
+	rdlocks.insert(&desttrace[0]->lock);
 	dout(10) << "rename prepending desttrace with " << *desttrace[0] << dendl;
 	destbase = destbase->get_projected_parent_dn()->get_dir()->get_inode();
       }