diff options
author | Martynas Pumputis <m@lambda.lt> | 2019-01-31 10:19:33 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-13 14:03:20 -0700 |
commit | 3084058a72e297e7dbce277b8161fc323d087d1d (patch) | |
tree | 4ead9b5e476404cd1c941c4a5859a09159c24572 /fs/nls/nls_cp775.c | |
parent | 167a0989ec15a0b738dc8fd25922b1fae00c0dba (diff) | |
download | linux-stable-3084058a72e297e7dbce277b8161fc323d087d1d.tar.gz linux-stable-3084058a72e297e7dbce277b8161fc323d087d1d.tar.bz2 linux-stable-3084058a72e297e7dbce277b8161fc323d087d1d.zip |
bpf, selftests: fix handling of sparse CPU allocations
[ Upstream commit 1bb54c4071f585ebef56ce8fdfe6026fa2cbcddd ]
Previously, bpf_num_possible_cpus() had a bug when calculating a
number of possible CPUs in the case of sparse CPU allocations, as
it was considering only the first range or element of
/sys/devices/system/cpu/possible.
E.g. in the case of "0,2-3" (CPU 1 is not available), the function
returned 1 instead of 3.
This patch fixes the function by making it parse all CPU ranges and
elements.
Signed-off-by: Martynas Pumputis <m@lambda.lt>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nls/nls_cp775.c')
0 files changed, 0 insertions, 0 deletions