From a09070ab45d5c8b6d66e930fff50aaa32cf20bb7 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Sun, 4 May 2014 10:15:36 +0800 Subject: [PATCH] mds: allow negetive rstat When splitting dirfrag, delta rstat is always added to the first new dirfrag. Ancestors of the dirfrag may have nagtive rstat before the delta rstat has been propagated to them. For example: inode 100 n(v1 b-4096) |- dir 100 n(v1 b-4096) |- dentry |- inode 101 n(v1 b-4096) |- dir 101.0* n(v1)/n(v1 b-4096) |- dir 101.1* n(v1) Signed-off-by: Yan, Zheng --- src/mds/CInode.cc | 16 ---------------- src/mds/MDCache.cc | 3 --- 2 files changed, 19 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index a7983ecca47d..9ca1cf20b287 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -1929,22 +1929,6 @@ void CInode::finish_scatter_gather_update(int type) pi->rstat.version = v; } } - - if (pi->rstat.rsubdirs < 0 || - pi->rstat.rfiles < 0 || - pi->rstat.rbytes < 0) { - clog.error() << "bad/negative rstat on " << ino() - << ", inode has " << pi->rstat << "\n"; - - if (pi->rstat.rsubdirs < 0) - pi->rstat.rsubdirs = 0; - if (pi->rstat.rfiles < 0) - pi->rstat.rfiles = 0; - if (pi->rstat.rbytes < 0) - pi->rstat.rbytes = 0; - - assert(!"bad/negative rstat" == g_conf->mds_verify_scatter); - } } break; diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 4312c3312747..1236c96db8c1 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -1809,9 +1809,6 @@ 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 && pin->dirfragtree.is_leaf(frag_t())) - assert(!"negative rstat rbytes" == g_conf->mds_verify_scatter); - last = first-1; } } -- 2.47.3