From: Sage Weil Date: Fri, 10 Apr 2015 15:43:45 +0000 (-0700) Subject: crush: fix has_v4_buckets() X-Git-Tag: v0.94.1~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4328%2Fhead;p=ceph.git crush: fix has_v4_buckets() alg, not type! This bug made us incorrectly think we were using v4 features when user type 5 was being used. That's currently 'rack' with recent crush maps, but was other types for clusters that were created with older versions. This is clearly problematic as it will lock out non-hammer clients incorrectly, breaking deployments on upgrade. Fixes: #11364 Backport: hammer Signed-off-by: Sage Weil (cherry picked from commit 38b35ab9d17eb84ac178c4cd3ebcf2ec0f66d8b6) --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index d0c24af12c9..497c2196958 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -72,7 +72,7 @@ bool CrushWrapper::has_v4_buckets() const crush_bucket *b = crush->buckets[i]; if (!b) continue; - if (b->type == CRUSH_BUCKET_STRAW2) + if (b->alg == CRUSH_BUCKET_STRAW2) return true; } return false;