From: Sage Weil Date: Thu, 23 Sep 2010 23:20:00 +0000 (-0700) Subject: mds: error to log when inode/dirfrag rbytes get out of sync X-Git-Tag: v0.22~116 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c503d362b86d082ae16a0a1a05c0860cbffa31f8;p=ceph.git mds: error to log when inode/dirfrag rbytes get out of sync Signed-off-by: Sage Weil --- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 572fbf31b2245..1a85fc3f7a770 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -1487,6 +1487,20 @@ void CInode::finish_scatter_gather_update(int type) } dir->dirty_old_rstat.clear(); pf->rstat.version = pf->accounted_rstat.version = pi->rstat.version + 1; + + if (fg == 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 " << dir->dirfrag() + << ", inode has " << pi->rstat << ", dirfrag has " << pf->rstat; + mdcache->mds->logclient.log(LOG_ERROR, ss); + + // trust the dirfrag for now + pi->rstat = pf->rstat; + pi->rstat.version--; // (about to re-increment it below!) + assert("unmatched rstat rbytes" == 0); + } + } } pi->rstat.version++; dout(20) << " final rstat " << pi->rstat << dendl;