]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Allow rename request for stray migration/reintegration
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 2 Oct 2012 08:55:44 +0000 (16:55 +0800)
committerSage Weil <sage@inktank.com>
Tue, 2 Oct 2012 18:22:35 +0000 (11:22 -0700)
Allow rename request to modify system directory if it is for stray
migration/reintegration.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Server.cc

index 4c52ca2f36d6c03367c79f950e7ed5ce9e2eff6d..8584e60fdd61c57e7ad5c3f81b457d8ddf87f70f 100644 (file)
@@ -1983,7 +1983,7 @@ CDentry* Server::rdlock_path_xlock_dentry(MDRequest *mdr, int n,
   }
 
   CInode *diri = dir->get_inode();
-  if (diri->is_system() && !diri->is_root()) {
+  if (!mdr->reqid.name.is_mds() && diri->is_system() && !diri->is_root()) {
     reply_request(mdr, -EROFS);
     return 0;
   }
@@ -5126,10 +5126,12 @@ void Server::handle_client_rename(MDRequest *mdr)
     pdn = pdn->get_dir()->inode->parent;
   }
 
-  // is this a stray reintegration or merge? (sanity checks!)
+  // is this a stray migration, reintegration or merge? (sanity checks!)
   if (mdr->reqid.name.is_mds() &&
-      (!destdnl->is_remote() ||
-       destdnl->get_remote_ino() != srci->ino())) {
+      !(MDS_INO_IS_STRAY(srcpath.get_ino()) &&
+       MDS_INO_IS_STRAY(destpath.get_ino())) &&
+      !(destdnl->is_remote() &&
+       destdnl->get_remote_ino() == srci->ino())) {
     reply_request(mdr, -EINVAL);  // actually, this won't reply, but whatev.
     return;
   }