]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: fix rename into sub-directory check 5849/head
authorYan, Zheng <zyan@redhat.com>
Mon, 14 Sep 2015 01:39:34 +0000 (09:39 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 14 Sep 2015 07:03:19 +0000 (15:03 +0800)
the check is important for FreeBSD because there is such check
in its kernel.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/Server.cc

index 7dfaaa24e07e475dc95319b4f8ccbe98a8aa67cd..da6475b5fb15339855d93aa2b84011c96cc3f204 100644 (file)
@@ -5927,7 +5927,7 @@ void Server::handle_client_rename(MDRequestRef& mdr)
 
   // dest a child of src?
   // e.g. mv /usr /usr/foo
-  CDentry *pdn = destdir->inode->parent;
+  CDentry *pdn = destdir->inode->get_projected_parent_dn();
   while (pdn) {
     if (pdn == srcdn) {
       dout(7) << "cannot rename item to be a child of itself" << dendl;