diff options
author | Sage Weil <sage@inktank.com> | 2013-06-28 12:51:07 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-28 12:54:08 -0700 |
commit | 2a4a05bb913bf0eac17e3997aadff4082293d0b7 (patch) | |
tree | 54b829c55ab94390178f4327d29c686d075c87ff | |
parent | 2e857a4df64b87b4472a4c103449cd8496022502 (diff) | |
download | ceph-2a4a05bb913bf0eac17e3997aadff4082293d0b7.tar.gz |
mds/Server: fix LOOKUPSNAPwip-mds-snap
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>
-rw-r--r-- | src/mds/Server.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 627ecd0cdb7..da38fe2e2ef 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; |