]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Server: fix LOOKUPSNAP
authorSage Weil <sage@inktank.com>
Fri, 28 Jun 2013 19:51:07 +0000 (12:51 -0700)
committerGreg Farnum <greg@inktank.com>
Thu, 26 Sep 2013 00:08:23 +0000 (17:08 -0700)
The current LOOKUPSNAP code path was dereferencing mdr->dn[0] and getting
SEGV.  Instead, set the do_lookup arg to false for getattr so that we do
not try to dereference this; for snaps it will always be NULL as we are
constructing a fake namespace for the .snap directory.  (This happens in
the path_traverse, the result of which is to set snapid--without any real
dentry).

With this fix, snaptest-0.sh passes.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mds/Server.cc

index c6f48c2a1f7ae2d92fdb816116ebb50006f05d73..3140194abdc5742a75adb2006476a7ce56b7ffb5 100644 (file)
@@ -1167,10 +1167,11 @@ void Server::dispatch_client_request(MDRequest *mdr)
 
     // inodes ops.
   case CEPH_MDS_OP_LOOKUP:
-  case CEPH_MDS_OP_LOOKUPSNAP:
     handle_client_getattr(mdr, true);
     break;
 
+  case CEPH_MDS_OP_LOOKUPSNAP:
+    // lookupsnap does not reference a CDentry; treat it as a getattr
   case CEPH_MDS_OP_GETATTR:
     handle_client_getattr(mdr, false);
     break;