From: Sage Weil Date: Thu, 4 Nov 2010 20:04:47 +0000 (-0700) Subject: mds: verify single frag rstat on projection too X-Git-Tag: v0.23~38 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f23ba003d72fa6dd75e483135980874f6684e094;p=ceph.git mds: verify single frag rstat on projection too Currently we do a sanity check on gather; do the same check in project_rstat_frag_to_inode(). Signed-off-by: Sage Weil --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 57ffb192d285..8ba2dbad1966 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -1883,6 +1883,20 @@ void MDCache::predirty_journal_parents(Mutation *mut, EMetaBlob *blob, project_rstat_frag_to_inode(p->second.rstat, p->second.accounted_rstat, p->second.first, p->first, pin, true);//false); parent->dirty_old_rstat.clear(); project_rstat_frag_to_inode(pf->rstat, pf->accounted_rstat, parent->first, CEPH_NOSNAP, pin, true);//false); + + if (parent->get_frag() == frag_t()) { // i.e., we are the only frag + if (pi->rstat.rbytes != pf->rstat.rbytes) { + stringstream ss; + ss << "unmatched rstat rbytes on single dirfrag " << parent->dirfrag() + << ", inode has " << pi->rstat << ", dirfrag has " << pf->rstat; + mds->logclient.log(LOG_ERROR, ss); + + // trust the dirfrag for now + pi->rstat = pf->rstat; + + assert(!"unmatched rstat rbytes" == g_conf.mds_verify_scatter); + } + } // bump version pi->rstat.version++;