From 26c00c5b2b0e88d0ec7afb876f6cef168107da32 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Mon, 2 Dec 2013 15:11:54 -0800 Subject: [PATCH] OSDMonitor: return EEXIST if users try to do a PG merge This was returning a machine-code success if users tried to merge, and was erroneously (but harmlessly) increasing the pool's last_change marker even though it wasn't actually changing anything. Backport: emperor Signed-off-by: Greg Farnum --- src/mon/OSDMonitor.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 058a5cfeef3..7cc2f0d82b6 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2802,6 +2802,10 @@ int OSDMonitor::prepare_command_pool_set(map &cmdmap, } if (n <= (int)p.get_pg_num()) { ss << "specified pg_num " << n << " <= current " << p.get_pg_num(); + if (n < (int)p.get_pg_num()) + return -EEXIST; + else + return 0; } else { for(set::iterator i = mon->pgmon()->pg_map.creating_pgs.begin(); i != mon->pgmon()->pg_map.creating_pgs.end(); -- 2.47.3