The state.mtx protects state.events accessed both from readdir and gc.
Fixes: http://tracker.ceph.com/issues/20121
Signed-off-by: Gui Hecheng <guihecheng@cmss.chinamobile.com>
inc_nlink(req.d_count);
*eof = req.eof();
event ev(event::type::READDIR, get_key(), state.atime);
+ lock_guard sguard(fs->state.mtx);
fs->state.push_event(ev);
}
} else {
inc_nlink(req.d_count);
*eof = req.eof();
event ev(event::type::READDIR, get_key(), state.atime);
+ lock_guard sguard(fs->state.mtx);
fs->state.push_event(ev);
}
}