From: Sage Weil Date: Fri, 28 Jun 2013 19:51:07 +0000 (-0700) Subject: mds/Server: fix LOOKUPSNAP X-Git-Tag: v0.71~71^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3cffff2a1abd266abbbc97effd73b79695d29682;p=ceph.git mds/Server: fix LOOKUPSNAP 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 Reviewed-by: Greg Farnum --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index c6f48c2a1f7a..3140194abdc5 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -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;