]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make straydn.first match the inode
authorSage Weil <sage@newdream.net>
Wed, 21 Jan 2009 19:47:04 +0000 (11:47 -0800)
committerSage Weil <sage@newdream.net>
Wed, 21 Jan 2009 19:47:04 +0000 (11:47 -0800)
src/mds/MDCache.cc

index 9511838e9be660c65839c5b3988fc48de94ae1e1..55606411c0e6b2f2f193d88c6ae0055da861700f 100644 (file)
@@ -304,9 +304,13 @@ CDentry *MDCache::get_or_create_stray_dentry(CInode *in)
   CDir *straydir = stray->get_or_open_dirfrag(this, fg);
   
   CDentry *straydn = straydir->lookup(straydname);
-  if (!straydn) 
+  if (!straydn)
     straydn = straydir->add_null_dentry(straydname);
-  
+  else
+    assert(straydn->get_projected_linkage()->is_null());
+
+  straydn->first = in->first;
+
   return straydn;
 }