From: Sage Weil Date: Thu, 12 Jun 2008 21:22:40 +0000 (-0700) Subject: mds: rdlock dft during readdir X-Git-Tag: v0.3~130 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c9108d3d219d687788fda2f8bc0d68c3cffe10a7;p=ceph.git mds: rdlock dft during readdir --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index d030a3b4d058..13cf73104101 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -1261,7 +1261,7 @@ CDir *Server::traverse_to_auth_dir(MDRequest *mdr, vector &trace, file -CInode* Server::rdlock_path_pin_ref(MDRequest *mdr, bool want_auth) +CInode* Server::rdlock_path_pin_ref(MDRequest *mdr, bool want_auth, bool rdlock_dft) { dout(10) << "rdlock_path_pin_ref " << *mdr << dendl; @@ -1344,6 +1344,8 @@ CInode* Server::rdlock_path_pin_ref(MDRequest *mdr, bool want_auth) for (int i=0; i<(int)trace.size(); i++) rdlocks.insert(&trace[i]->lock); + if (rdlock_dft) + rdlocks.insert(&ref->dirfragtreelock); if (!mds->locker->acquire_locks(mdr, rdlocks, empty, empty)) return 0; @@ -1817,7 +1819,7 @@ void Server::handle_client_readdir(MDRequest *mdr) { MClientRequest *req = mdr->client_request; int client = req->get_client().num(); - CInode *diri = rdlock_path_pin_ref(mdr, false); + CInode *diri = rdlock_path_pin_ref(mdr, false, true); // rdlock dirfragtreelock! if (!diri) return; // it's a directory, right? @@ -1842,6 +1844,7 @@ void Server::handle_client_readdir(MDRequest *mdr) if (!dir) return; // ok! + dout(10) << "handle_client_readdir on " << *dir << dendl; assert(dir->is_auth()); // check perm diff --git a/src/mds/Server.h b/src/mds/Server.h index 90d768929b54..bcd34e40b745 100644 --- a/src/mds/Server.h +++ b/src/mds/Server.h @@ -98,7 +98,7 @@ public: CDentry *prepare_null_dentry(MDRequest *mdr, CDir *dir, const string& dname, bool okexist=false); CInode* prepare_new_inode(MDRequest *mdr, CDir *dir); - CInode* rdlock_path_pin_ref(MDRequest *mdr, bool want_auth); + CInode* rdlock_path_pin_ref(MDRequest *mdr, bool want_auth, bool rdlock_dft=false); CDentry* rdlock_path_xlock_dentry(MDRequest *mdr, bool okexist, bool mustexist); CDir* try_open_auth_dirfrag(CInode *diri, frag_t fg, MDRequest *mdr);