Skip to content

Commit

Permalink
mds/Server: fix LOOKUPSNAP
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Greg Farnum <[email protected]>
  • Loading branch information
Sage Weil authored and gregsfortytwo committed Sep 26, 2013
1 parent 52c7f27 commit 3cffff2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mds/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3cffff2

Please sign in to comment.