]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: set epoch_created and parent_split_bits for child pg 8805/head
authorKefu Chai <kchai@redhat.com>
Tue, 12 Apr 2016 09:31:27 +0000 (17:31 +0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 28 Apr 2016 08:54:03 +0000 (10:54 +0200)
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 <kchai@redhat.com>
(cherry picked from commit 8b985561ba08d4ed2d7751a8e09f9d9067c5fbd3)

src/osd/PG.cc

index 7917638b1e7248def5725e0247ce973e03f8aff5..cac1df5fd899b8bb23f2e620d7faff5aab1be886 100644 (file)
@@ -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;