Skip to content

Commit

Permalink
osd: add a comment for the purpose of pinned_maps
Browse files Browse the repository at this point in the history
For a better understanding since it can confuse newcommers.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Aug 4, 2016
1 parent 00aeae8 commit cfe7b0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6633,6 +6633,12 @@ void OSD::trim_maps(epoch_t oldest, int nreceived, bool skip_maps)
void OSD::handle_osd_map(MOSDMap *m)
{
assert(osd_lock.is_locked());
// Keep a ref in the list until we get the newly received map written
// onto disk. This is important because as long as the refs are alive,
// the OSDMaps will be pinned in the cache and we won't try to read it
// off of disk. Othwise these maps will probably not stay in the cache,
// and reading those OSDMaps before they are actually written can
// results in a crash.
list<OSDMapRef> pinned_maps;
if (m->fsid != monc->get_fsid()) {
dout(0) << "handle_osd_map fsid " << m->fsid << " != "
Expand Down

0 comments on commit cfe7b0f

Please sign in to comment.