Merge pull request #23904 from xiexingguo/wip-27985

osd/PG: fix misused FORCE_RECOVERY[BACKFILL] flags

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
David Zafman 2019-01-25 16:44:22 -08:00 committed by GitHub
commit 74239605a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2408,18 +2408,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;
}