]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: insert lssnap results under snapdir, not live dir
authorSage Weil <sage@newdream.net>
Fri, 12 Nov 2010 15:55:41 +0000 (07:55 -0800)
committerSage Weil <sage@newdream.net>
Fri, 12 Nov 2010 15:55:41 +0000 (07:55 -0800)
Put the readdir results (list of snapshots) in the right place in the
hierarchy; we were putting them in the parent dir (as if they were real
directories).

This bug manifested itself as a snaptest-2.sh failure.

Signed-off-by: Sage Weil <sage@newdream.net>
src/client/Client.cc

index 831b4358f98338971e6c5cb65fd9ab3a7dcaeb6d..e591ba75bad0db815c98b12993403664e35c90cf 100644 (file)
@@ -545,7 +545,7 @@ Dentry *Client::insert_dentry_inode(Dir *dir, const string& dname, LeaseStat *dl
     dn = dir->dentries[dname];
   
   dout(12) << "insert_dentry_inode " << dname << " vino " << in->vino()
-          << " in dir " << dir->parent_inode->ino
+          << " in dir " << dir->parent_inode->vino()
            << dendl;
   
   if (dn && dn->inode) {
@@ -727,6 +727,10 @@ Inode* Client::insert_trace(MetaRequest *request, utime_t from, int mds)
   // the rest?
   p = reply->get_extra_bl().begin();
   if (!p.end()) {
+    // snapdir?
+    if (request->head.op == CEPH_MDS_OP_LSSNAP)
+      in = open_snapdir(in);
+
     // only open dir if we're actually adding stuff to it!
     Dir *dir = in->open_dir();
     assert(dir);