null_blk: prevent crash from bad home_node value
authorJohn Pittman <jpittman@redhat.com>
Fri, 5 Apr 2019 21:42:45 +0000 (17:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:22:54 +0000 (07:22 +0200)
commite91fcd8326c6c432aa428ad92b92b122469f92f5
treea8918ea1757f80c0da9e11d23402dd375afee4dc
parentb174065805b55300d9d4e6ae6865c7b0838cc0f4
null_blk: prevent crash from bad home_node value

[ Upstream commit 7ff684a683d777c4956fce93e60accbab2bd7696 ]

At module load, if the selected home_node value is greater than
the available numa nodes, the system will crash in
__alloc_pages_nodemask() due to a bad paging request.  Prevent this
user error crash by detecting the bad value, logging an error, and
setting g_home_node back to the default of NUMA_NO_NODE.

Signed-off-by: John Pittman <jpittman@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
drivers/block/null_blk_main.c