diff options
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 9712bcc8e069..9b465bb68487 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2541,6 +2541,20 @@ int set_resource_options(struct drbd_resource *resource, struct res_opts *res_op | |||
2541 | if (nr_cpu_ids > 1 && res_opts->cpu_mask[0] != 0) { | 2541 | if (nr_cpu_ids > 1 && res_opts->cpu_mask[0] != 0) { |
2542 | err = bitmap_parse(res_opts->cpu_mask, DRBD_CPU_MASK_SIZE, | 2542 | err = bitmap_parse(res_opts->cpu_mask, DRBD_CPU_MASK_SIZE, |
2543 | cpumask_bits(new_cpu_mask), nr_cpu_ids); | 2543 | cpumask_bits(new_cpu_mask), nr_cpu_ids); |
2544 | if (err == -EOVERFLOW) { | ||
2545 | /* So what. mask it out. */ | ||
2546 | cpumask_var_t tmp_cpu_mask; | ||
2547 | if (zalloc_cpumask_var(&tmp_cpu_mask, GFP_KERNEL)) { | ||
2548 | cpumask_setall(tmp_cpu_mask); | ||
2549 | cpumask_and(new_cpu_mask, new_cpu_mask, tmp_cpu_mask); | ||
2550 | drbd_warn(resource, "Overflow in bitmap_parse(%.12s%s), truncating to %u bits\n", | ||
2551 | res_opts->cpu_mask, | ||
2552 | strlen(res_opts->cpu_mask) > 12 ? "..." : "", | ||
2553 | nr_cpu_ids); | ||
2554 | free_cpumask_var(tmp_cpu_mask); | ||
2555 | err = 0; | ||
2556 | } | ||
2557 | } | ||
2544 | if (err) { | 2558 | if (err) { |
2545 | drbd_warn(resource, "bitmap_parse() failed with %d\n", err); | 2559 | drbd_warn(resource, "bitmap_parse() failed with %d\n", err); |
2546 | /* retcode = ERR_CPU_MASK_PARSE; */ | 2560 | /* retcode = ERR_CPU_MASK_PARSE; */ |