]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: improve no-op cache_mode set check
authorSage Weil <sage@redhat.com>
Thu, 24 Jul 2014 17:06:31 +0000 (10:06 -0700)
committerSage Weil <sage@redhat.com>
Fri, 1 Aug 2014 23:40:50 +0000 (16:40 -0700)
If we have a pending pool value but the cache_mode hasn't changed, this is
still a no-op (and we don't need to block).

Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 67d13d76f5692fa20649ea877f254c34094c11f6)

src/mon/OSDMonitor.cc

index a1651c4ab479793a2f6e0c07d958a2a109cfe34a..69b845d38039e1034a070685e639a30fafd38a6e 100644 (file)
@@ -5186,7 +5186,9 @@ done:
     }
 
     // pool already has this cache-mode set and there are no pending changes
-    if (p->cache_mode == mode && pending_inc.new_pools.count(pool_id) == 0) {
+    if (p->cache_mode == mode &&
+       (pending_inc.new_pools.count(pool_id) == 0 ||
+        pending_inc.new_pools[pool_id].cache_mode == p->cache_mode)) {
       ss << "set cache-mode for pool '" << poolstr << "'"
          << " to " << pg_pool_t::get_cache_mode_name(mode);
       err = 0;