]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix snaprealm split on capless inode
authorSage Weil <sage@newdream.net>
Mon, 26 Apr 2010 17:14:58 +0000 (10:14 -0700)
committerSage Weil <sage@newdream.net>
Mon, 26 Apr 2010 21:08:27 +0000 (14:08 -0700)
src/mds/snap.cc

index c5172f4384583f34211d55d9430d1f752886f326..7fa86b31c07c88cd556629dcf0a69f38973aa75d 100644 (file)
@@ -363,10 +363,16 @@ void SnapRealm::split_at(SnapRealm *child)
           << " on " << *child->inode << dendl;
 
   if (!child->inode->is_dir()) {
-    // it's not a dir:
-    //  - no open children.
-    //  - only need to move this child's inode's caps.
-    child->inode->move_to_realm(child);
+    if (child->inode->containing_realm) {
+      // it's not a dir:
+      //  - no open children.
+      //  - only need to move this child's inode's caps.
+      child->inode->move_to_realm(child);
+    } else {
+      // no caps, nothing to move/split.
+      dout(20) << " split no-op, no caps to move on file " << *child->inode << dendl;
+      assert(!child->inode->is_any_caps());
+    }
     return;
   }