]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix negative dirstat assertion
authorYan, Zheng <zheng.z.yan@intel.com>
Wed, 26 Mar 2014 02:15:15 +0000 (10:15 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Fri, 28 Mar 2014 18:08:14 +0000 (02:08 +0800)
When splitting dirfrag, delta dirstat is always added to the first new
dirfrag. Before the delta dirstat is propagated to inode, unlinking file
from the rest dirfrags can cause nagtive inode dirstat.

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

index d61ba48403cec1638cde11fd1b65a6f9d0a51928..e68b49b99d7958fa2fb02ac44d97dfd7465b7460 100644 (file)
@@ -2058,9 +2058,9 @@ void MDCache::predirty_journal_parents(Mutation *mut, EMetaBlob *blob,
        pi->mtime = pi->ctime = pi->dirstat.mtime;
       dout(20) << "predirty_journal_parents     gives " << pi->dirstat << " on " << *pin << dendl;
 
-      if (pi->dirstat.size() < 0)
-       assert(!"negative dirstat size" == g_conf->mds_verify_scatter);
       if (parent->get_frag() == frag_t()) { // i.e., we are the only frag
+       if (pi->dirstat.size() < 0)
+         assert(!"negative dirstat size" == g_conf->mds_verify_scatter);
        if (pi->dirstat.size() != pf->fragstat.size()) {
          mds->clog.error() << "unmatched fragstat size on single dirfrag "
             << parent->dirfrag() << ", inode has " << pi->dirstat