From: Zengran Zhang Date: Tue, 4 Dec 2018 13:19:18 +0000 (+0800) Subject: osd: avoid using null agent_state X-Git-Tag: v14.1.0~681^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6ff879d9bd70dddd73995b6a2fbdb34300620b2;p=ceph.git osd: avoid using null agent_state the agent_state has no lock guard,so need to check if it is null Signed-off-by: Zengran Zhang --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 77210e2c861..ff34105ab1c 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -10146,7 +10146,8 @@ int PrimaryLogPG::try_flush_mark_clean(FlushOpRef fop) } // successfully flushed, can we evict this object? - if (!obc->obs.oi.has_manifest() && !fop->op && agent_state->evict_mode != TierAgentState::EVICT_MODE_IDLE && + if (!obc->obs.oi.has_manifest() && !fop->op && + agent_state && agent_state->evict_mode != TierAgentState::EVICT_MODE_IDLE && agent_maybe_evict(obc, true)) { osd->logger->inc(l_osd_tier_clean); if (fop->on_flush) {