diff mbox

[2/5] mds: fix handle_client_openc() hang

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

Commit Message

Yan, Zheng Nov. 30, 2012, 2:36 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

handle_client_openc() calls handle_client_open() if the linkage isn't
null. handle_client_open() calls rdlock_path_pin_ref() which returns
mdr->in[0] directly because mdr->done_locking is true. the problem here
is that mdr->in[0] can be NULL if the linkage is remote.

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

Patch

diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 4c66f4a..59d7d3c 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -2637,6 +2637,12 @@  void Server::handle_client_openc(MDRequest *mdr)
       reply_request(mdr, -EEXIST, dnl->get_inode(), dn);
       return;
     } 
+
+    mdcache->request_drop_non_rdlocks(mdr);
+
+    // remote link, avoid rdlock_path_pin_ref() returning null
+    if (!mdr->in[0])
+      mdr->done_locking = false;
     
     handle_client_open(mdr);
     return;