From 74ef370b02c9a94926e377ecac8365721a88001d Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 20 Jan 2014 10:05:39 +0800 Subject: [PATCH] mds: fix negative rstat assertion when gathering rstat for directory inode that is fragmented to several dirfrags, inode's rstat may temporarily become nagtive. This is because, when splitting dirfrag, delta rstat is always added to the first new dirfrag. Signed-off-by: Yan, Zheng --- src/mds/MDCache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 2bdb2290b48e4..86276f5245888 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -1837,7 +1837,7 @@ void MDCache::project_rstat_frag_to_inode(nest_info_t& rstat, nest_info_t& accou pi->rstat.add(delta); dout(20) << " result [" << first << "," << last << "] " << pi->rstat << dendl; - if (pi->rstat.rbytes < 0) + if (pi->rstat.rbytes < 0 && pin->dirfragtree.is_leaf(frag_t())) assert(!"negative rstat rbytes" == g_conf->mds_verify_scatter); last = first-1; -- 2.39.5