Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 83d435dd authored by Xie XiuQi's avatar Xie XiuQi Committed by Tony Luck
Browse files

Fix example error_injection_tool



I got a "sched_setaffinity:: Invalid argument" error when using
err_injection_tool to inject error on a system with over 32 cpus.

Error information when injecting an error on a system with over 32 cpus:
$ ./err_injection_tool -i
/sys/devices/system/cpu/cpu0/err_inject//err_type_info
Begine at Tue Mar 26 11:20:08 2013
Configurations:
On cpu32: loop=10, interval=5(s) err_type_info=4101,err_struct_info=95
Error sched_setaffinity:: Invalid argument
All done

This because there is overflow when calculating the cpumask: the
type of (1<<k) is int, while mask[j] is unsigned long. When k > 31,
(1<<k) is truncated to ZERO, resulting in a unexpected cpumask.

Signed-off-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent eee46b3d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment