From 34ef91a2790eaee6afefdc2e140effde620bd76b Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 26 Mar 2014 10:15:15 +0800 Subject: [PATCH] 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 --- src/mds/MDCache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index d61ba48403cec..e68b49b99d795 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 -- 2.39.5