From: Yan, Zheng Date: Wed, 26 Mar 2014 02:15:15 +0000 (+0800) Subject: mds: fix negative dirstat assertion X-Git-Tag: v0.79~52^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=34ef91a2790eaee6afefdc2e140effde620bd76b;p=ceph.git mds: fix negative dirstat assertion 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 --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index d61ba48403ce..e68b49b99d79 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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