]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: include projected dn+inode to client if xlock_done
authorSage Weil <sage@newdream.net>
Mon, 12 Jan 2009 23:16:01 +0000 (15:16 -0800)
committerSage Weil <sage@newdream.net>
Mon, 12 Jan 2009 23:16:01 +0000 (15:16 -0800)
We should see the result in a readdir after a mkdir etc, even if it
hasn't journaled yet.  E.g., we should be able to killall -STOP cosd,
then

$ mkdir foo ; ls
foo

src/mds/Server.cc

index 8652e4d3dbea0d74969732ab414f782d46a9a9ec..05949998244b1bb168db028cb86fe7c4164a1c2b 100644 (file)
@@ -2199,7 +2199,9 @@ void Server::handle_client_readdir(MDRequest *mdr)
     CDentry *dn = it->second;
     it++;
 
-    if (dn->is_null()) continue;
+    if (dn->is_null() &&
+       !(dn->get_projected_inode() &&
+         dn->lock.can_rdlock(mdr, client))) continue;
     if (snaps && dn->last != CEPH_NOSNAP) {
       set<snapid_t>::const_iterator p = snaps->lower_bound(dn->first);
       if (p == snaps->end() || *p > dn->last) {
@@ -2211,6 +2213,9 @@ void Server::handle_client_readdir(MDRequest *mdr)
       continue;
 
     CInode *in = dn->get_inode();
+    if (dn->get_projected_inode() &&
+       dn->lock.can_rdlock(mdr, client))
+      in = dn->get_projected_inode();
 
     // remote link?
     // better for the MDS to do the work, if we think the client will stat any of these files.