]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: wrlock dir mtime on create, even if neg dentry exists
authorSage Weil <sage@newdream.net>
Mon, 7 Apr 2008 21:35:49 +0000 (14:35 -0700)
committerSage Weil <sage@newdream.net>
Mon, 7 Apr 2008 21:35:49 +0000 (14:35 -0700)
src/mds/Server.cc

index 16dabc7915c675b751dbd5bb70b7d5656615d4b1..fce1e38269a4a1202d7ec3f2927c8e0666d12738 100644 (file)
@@ -1389,11 +1389,11 @@ CDentry* Server::rdlock_path_xlock_dentry(MDRequest *mdr, bool okexist, bool mus
 
   for (int i=0; i<(int)trace.size(); i++) 
     rdlocks.insert(&trace[i]->lock);
-  if (dn->is_null()) {
+  if (dn->is_null())
     xlocks.insert(&dn->lock);                 // new dn, xlock
-    wrlocks.insert(&dn->dir->inode->dirlock); // also, wrlock on dir mtime
-  } else
+  else
     rdlocks.insert(&dn->lock);  // existing dn, rdlock
+  wrlocks.insert(&dn->dir->inode->dirlock); // also, wrlock on dir mtime
 
   if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
     return 0;