]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Server: ensure slave mdses have full dest tree
authorGreg Farnum <gregory.farnum@dreamhost.com>
Tue, 22 Mar 2011 21:23:33 +0000 (14:23 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Sun, 17 Apr 2011 03:59:45 +0000 (20:59 -0700)
We were already taking rdlocks on the source tree, to make
sure that each slave MDS could traverse to the source dentry. Now,
if there are slave MDSes, we take rdlocks on each destination
ancestor to make sure the slaves can also traverse there.
This fixes an fsstress bug.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mds/Server.cc

index 4c5840c27cc919464c46926a5adf1da94b377971..d2fdccd910caf0a23d1d3cd59e09803c7113d4b2 100644 (file)
@@ -4764,6 +4764,10 @@ void Server::handle_client_rename(MDRequest *mdr)
       xlocks.insert(&srcdn->versionlock);
     if (destdn->is_projected())
       xlocks.insert(&destdn->versionlock);
+    // also take rdlock on all ancestor dentries for destdn.  this ensures that the
+    // destdn can be traversed to by the witnesses.
+    for (int i=0; i<(int)desttrace.size(); i++) 
+      xlocks.insert(&desttrace[i]->versionlock);
   }
 
   // we need to update srci's ctime.  xlock its least contended lock to do that...