io-wq: fix max-workers not correctly set on multi-node system
authorBeld Zhang <beldzhang@gmail.com>
Tue, 2 Nov 2021 18:32:08 +0000 (12:32 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:17:05 +0000 (19:17 +0100)
commitcd63d080b9e88e9903f4466f79def4ddec072d2e
treee69289c0026ca7419253297b46e19b8136d31dae
parente99270d7f2731f532831923b9dd35b7be79158fe
io-wq: fix max-workers not correctly set on multi-node system

[ Upstream commit 71c9ce27bb57c59d8d7f5298e730c8096eef3d1f ]

In io-wq.c:io_wq_max_workers(), new_count[] was changed right after each
node's value was set. This caused the following node getting the setting
of the previous one.

Returned values are copied from node 0.

Fixes: 2e480058ddc2 ("io-wq: provide a way to limit max number of workers")
Signed-off-by: Beld Zhang <beldzhang@gmail.com>
[axboe: minor fixups]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io-wq.c