]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crush/CrushWrapper: ensure crush_choose_arg_map.size == max_buckets 27082/head
authorSage Weil <sage@redhat.com>
Fri, 8 Mar 2019 22:54:53 +0000 (16:54 -0600)
committerPrashant D <pdhange@redhat.com>
Thu, 21 Mar 2019 00:20:48 +0000 (20:20 -0400)
commitafe5177f072810becd921564a158ed823edb1d3b
tree86e80e8f803993a6ecea01040ebd28ae62065f82
parent41c7022b9248d17c4af9b61ca099ad5ca2d300dc
crush/CrushWrapper: ensure crush_choose_arg_map.size == max_buckets

The crush/builder.c crush_add_bucket method resizes the max_buckets array
but a power of 2 when it has to expand, but the code in CrushWrapper was
assuming that if the array grew the pos for the new bucket would be the
last position in the new array.  This led to a situation where the
crush_choose_arg_map args array size didn't match max_buckets, and
eventually caused a crash.

Fixes: http://tracker.ceph.com/issues/38664
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit ccda488815eeca608a58092d0d917c8a68a7b93c)

Conflicts:
src/crush/CrushWrapper.cc : Resolved in add_bucket
qa/workunits/mon/crush_ops.sh
src/crush/CrushWrapper.cc