Skip to content

Commit

Permalink
osd/PG: fix misused FORCE_RECOVERY[BACKFILL] flags
Browse files Browse the repository at this point in the history
__set_force_backfill__ should set PG_STATE_FORCED_BACKFILL
instead of PG_STATE_FORCED_RECOVERY.

Fixes: http://tracker.ceph.com/issues/27985
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Sep 4, 2018
1 parent ff192f4 commit 60ef742
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2368,18 +2368,18 @@ bool PG::set_force_backfill(bool b)
{
bool did = false;
if (b) {
if (!(state & PG_STATE_FORCED_RECOVERY) &&
if (!(state & PG_STATE_FORCED_BACKFILL) &&
(state & (PG_STATE_DEGRADED |
PG_STATE_BACKFILL_WAIT |
PG_STATE_BACKFILLING))) {
dout(10) << __func__ << " set" << dendl;
state_set(PG_STATE_FORCED_RECOVERY);
state_set(PG_STATE_FORCED_BACKFILL);
publish_stats_to_osd();
did = true;
}
} else if (state & PG_STATE_FORCED_RECOVERY) {
} else if (state & PG_STATE_FORCED_BACKFILL) {
dout(10) << __func__ << " clear" << dendl;
state_clear(PG_STATE_FORCED_RECOVERY);
state_clear(PG_STATE_FORCED_BACKFILL);
publish_stats_to_osd();
did = true;
}
Expand Down

0 comments on commit 60ef742

Please sign in to comment.