Commit 6677b0ad authored by Andrew Perepechko's avatar Andrew Perepechko Committed by Oleg Drokin
Browse files

LU-12352 libcfs: crashes with certain cpu part numbers

Due to a bug in the code, libcfs will crash if the
number of online cpus does not divide by the number
of cpu partitions.

Based on the checks in cfs_cpt_table_create(), it
appears that the original intent was to push the
remaining cpus into the initial partitions.

So let's do that properly.

Lustre-commit: e33e3da5

Change-Id: I3c5e2aa1fdfca4c07e7afce143c984973373f009
Cray-bug-id: LUS-6455
Signed-off-by: default avatarAndrew Perepechko <>
Reviewed-by: default avatarAlexander Boyko <>
Reviewed-by: default avatarAlexander Zarochentsev <>
Reviewed-by: default avatarGu Zheng <>
Reviewed-by: default avatarAlexandr Boyko <>

Reviewed-by: default avatarSerguei Smirnov <>
Tested-by: default avatarjenkins <>
Tested-by: default avatarMaloo <>
Reviewed-by: default avatarOleg Drokin <>
parent 284595fe
......@@ -904,7 +904,7 @@ static struct cfs_cpt_table *cfs_cpt_table_create(int ncpt)
int ncpu = cpumask_weight(part->cpt_cpumask);
rc = cfs_cpt_choose_ncpus(cptab, cpt, node_mask,
num - ncpu);
(rem > 0) + num - ncpu);
if (rc < 0) {
rc = -EINVAL;
goto failed_mask;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment