From: Kefu Chai Date: Tue, 12 Apr 2016 09:31:27 +0000 (+0800) Subject: PG: set epoch_created and parent_split_bits for child pg X-Git-Tag: v0.94.8~12^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec02d8b7b1610bd7fd00c201fb01ef80d3b9f05b;p=ceph.git PG: set epoch_created and parent_split_bits for child pg if we have a wrong "created", OSD receiving an osd_pg_create message could fail to project its history and crash. a bad split_bits could mislead the monitor and osd, and hence cause problems. * set child.info.history.epoch_created to osdmap.get_epoch() instead of using the parent's epoch_created * set child.info.stats.parent_split_bits to the calculated split_bits instead using the parent's split_bits Fixes: http://tracker.ceph.com/issues/15426 Signed-off-by: Kefu Chai (cherry picked from commit 8b985561ba08d4ed2d7751a8e09f9d9067c5fbd3) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7917638b1e7..cac1df5fd89 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2188,10 +2188,12 @@ void PG::split_into(pg_t child_pgid, PG *child, unsigned split_bits) // Info child->info.history = info.history; + child->info.history.epoch_created = get_osdmap()->get_epoch(); child->info.purged_snaps = info.purged_snaps; child->info.last_backfill = info.last_backfill; child->info.stats = info.stats; + child->info.stats.parent_split_bits = split_bits; info.stats.stats_invalid = true; child->info.stats.stats_invalid = true; child->info.last_epoch_started = info.last_epoch_started;