We only do the assimilate_dirty_rstat_inodes if we do an update AND the
frag rstat was non-stale, but the bottom half (_finish) doesn't have the
same info to know whether we did it because the top half updates the
fragstat version. Use a flag to indicate we've updated the dirfrag so
the bottom half will only run when needed.
Signed-off-by: Sage Weil <sage@newdream.net>
inode->mdcache->project_rstat_inode_to_frag(in, this, 0, 0);
}
+ state_set(STATE_ASSIMRSTAT);
dout(10) << "assimilate_dirty_rstat_inodes done" << dendl;
}
void CDir::assimilate_dirty_rstat_inodes_finish(Mutation *mut, EMetaBlob *blob)
{
+ if (!state_test(STATE_ASSIMRSTAT))
+ return;
+ state_clear(STATE_ASSIMRSTAT);
dout(10) << "assimilate_dirty_rstat_inodes_finish" << dendl;
elist<CInode*>::iterator p = dirty_rstat_inodes.begin_use_current();
while (!p.end()) {
static const unsigned STATE_FRAGMENTING = (1<<14);
static const unsigned STATE_STICKY = (1<<15); // sticky pin due to inode stickydirs
static const unsigned STATE_DNPINNEDFRAG = (1<<16); // dir is refragmenting
+ static const unsigned STATE_ASSIMRSTAT = (1<<17); // assimilating inode->frag rstats
// common states
static const unsigned STATE_CLEAN = 0;