• Xie XiuQi's avatar
    Fix example error_injection_tool · 83d435dd
    Xie XiuQi authored
    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
    Begine at Tue Mar 26 11:20:08 2013
    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>
err_inject.txt 25.2 KB