]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add assertion in handle_slave_rename_prep 10429/head
authorJohn Spray <john.spray@redhat.com>
Mon, 25 Jul 2016 14:09:29 +0000 (15:09 +0100)
committerJohn Spray <john.spray@redhat.com>
Mon, 25 Jul 2016 14:12:55 +0000 (15:12 +0100)
This function assumes that the source path
does not point to a null dentry, and that
path_traverse is therefore setting the
passed inode.

Candidate code path for crash
in http://tracker.ceph.com/issues/16807

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/Server.cc

index a2dcc97d0f91831d9513b18ff8b49031f1433345..17db88b1edc077cf03fd83f6526a9e1767414df4 100644 (file)
@@ -7153,10 +7153,13 @@ void Server::handle_slave_rename_prep(MDRequestRef& mdr)
   // discover srcdn
   filepath srcpath(mdr->slave_request->srcdnpath);
   dout(10) << " src " << srcpath << dendl;
-  CInode *srci;
+  CInode *srci = nullptr;
   r = mdcache->path_traverse(mdr, NULL, NULL, srcpath, &trace, &srci, MDS_TRAVERSE_DISCOVERXLOCK);
   if (r > 0) return;
   assert(r == 0);
+
+  // srcpath must not point to a null dentry
+  assert(srci != nullptr);
       
   CDentry *srcdn = trace[trace.size()-1];
   CDentry::linkage_t *srcdnl = srcdn->get_projected_linkage();