]> git.apps.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>
Thu, 24 Jul 2014 17:06:54 +0000 (10:06 -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>
src/mon/OSDMonitor.cc

index cc52d59887d10303cef00de2d126e0debf6432c6..d7734c5ffa9f0106300eaeba441bac8feb158974 100644 (file)
@@ -5379,7 +5379,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;