Whamcloud - gitweb
LU-13294 libcfs: incorrect rotor behaviour 49/38049/2
authorAndrew Perepechko <c17827@cray.com>
Fri, 14 Feb 2020 02:20:09 +0000 (05:20 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 6 Apr 2020 21:17:12 +0000 (21:17 +0000)
commit4f704583cd561a7b6ce38c032188a6b23d9faf38
treeaff7f1c27c6c175f5d32a796015e28b333a2ab61
parentfd50d435119f0993ee05a4653315e1a55627817b
LU-13294 libcfs: incorrect rotor behaviour

Signed int cpt rotor is set to -1 on initialization.
cfs_cpt_spread_node() improperly handles this value
via "if (!rotor--)" check. The condition is never true
with negative rotor values, so for_each_node_mask()
only exits with node = MAX_NUMNODES.

kmalloc_node() attempts to determine the zonelist based
on the passed node id and maps MAX_NUMNODES to some
random pointer. Crash.

BUG: unable to handle kernel paging request at 0000000100002007
IP: [<ffffffff847c0da7>] __alloc_pages_nodemask+0x97/0x420

Lustre-change: https://review.whamcloud.com/37709
Lustre-commit: f8aa86dd1622804d81020a7dbb1116f276b340f3

Change-Id: I4df74e394bdfc2a918d66aa12e6852ff0f6738ab
Signed-off-by: Andrew Perepechko <c17827@cray.com>
Cray-bug-id: LUS-8492
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38049
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs_cpu.h
libcfs/libcfs/libcfs_cpu.c