From f688ffabe63912aba3bb23d651e0938affc4e927 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 26 Apr 2010 10:14:58 -0700 Subject: [PATCH] mds: fix snaprealm split on capless inode --- src/mds/snap.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mds/snap.cc b/src/mds/snap.cc index c5172f4384583..7fa86b31c07c8 100644 --- a/src/mds/snap.cc +++ b/src/mds/snap.cc @@ -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; } -- 2.39.5