]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crush/CrushWrapper: ensure crush_choose_arg_map.size == max_buckets
authorSage Weil <sage@redhat.com>
Fri, 8 Mar 2019 22:54:53 +0000 (16:54 -0600)
committerSage Weil <sage@redhat.com>
Tue, 12 Mar 2019 16:26:43 +0000 (11:26 -0500)
commitccda488815eeca608a58092d0d917c8a68a7b93c
tree48adba77897ea989360d31d21e424131ae810aac
parentc7c4a49d6f226664423e07f8e81714ac026ef686
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>
qa/workunits/mon/crush_ops.sh
src/crush/CrushWrapper.cc