diff mbox

[26/29] mds: drop locks when opening remote dentry

Message ID 1357290140-17044-27-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>

Opening remote dentry while holding locks may cause dead lock. For example,
'discover' is blocked by a xlocked dentry, the request holding the xlock
is blocked by the locks hold by the readdir request.

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

Patch

diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 119af98..2531005 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -2901,6 +2901,8 @@  void Server::handle_client_readdir(MDRequest *mdr)
 	  break;
 	}
 
+	mds->locker->drop_locks(mdr);
+	mdr->drop_local_auth_pins();
 	mdcache->open_remote_dentry(dn, dnp, new C_MDS_RetryRequest(mdcache, mdr));
 	return;
       }