mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
libceph: initialize CRUSH choose argument weights
Initialize the CRUSH choose argument weight-set array before decoding so
entries start in a defined state while the decoder fills them.
Cc: stable@vger.kernel.org
Fixes: 5cf9c4a995 ("libceph, crush: per-pool crush_choose_arg_map for crush_do_rule()")
Reported-by: Vega <vega@nebusec.ai>
Assisted-by: LLM
Signed-off-by: Darong Lu <zzyy19904204639@163.com>
Signed-off-by: Ren Wei <weir@nebusec.ai>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
569a9bb1e5
commit
c3a995ff07
|
|
@ -319,7 +319,7 @@ static int decode_choose_arg(void **p, void *end, struct crush_choose_arg *arg)
|
|||
if (arg->weight_set_size) {
|
||||
u32 i;
|
||||
|
||||
arg->weight_set = kmalloc_objs(*arg->weight_set,
|
||||
arg->weight_set = kzalloc_objs(*arg->weight_set,
|
||||
arg->weight_set_size, GFP_NOIO);
|
||||
if (!arg->weight_set)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user