From 730781afec3fca97449f17879a241f4f411d1dd7 Mon Sep 17 00:00:00 2001 From: linbing Date: Fri, 26 May 2017 17:39:39 +0800 Subject: [PATCH] mon: it's no need to get pg action_primary osd twice in pg scrub Signed-off-by: linbing --- src/mon/PGMonitor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 151468a58970..2e7e08fe735c 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1000,12 +1000,12 @@ bool PGMonitor::preprocess_command(MonOpRequestRef op) r = -ENOENT; goto reply; } - if (pg_map.pg_stat[pgid].acting_primary == -1) { + int osd = pg_map.pg_stat[pgid].acting_primary; + if (osd == -1) { ss << "pg " << pgid << " has no primary osd"; r = -EAGAIN; goto reply; } - int osd = pg_map.pg_stat[pgid].acting_primary; if (!mon->osdmon()->osdmap.is_up(osd)) { ss << "pg " << pgid << " primary osd." << osd << " not up"; r = -EAGAIN; -- 2.47.3