io-wq: fix bug of creating io-wokers unconditionally
authorHao Xu <haoxu@linux.alibaba.com>
Sun, 8 Aug 2021 13:54:33 +0000 (21:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Aug 2021 07:06:57 +0000 (09:06 +0200)
commit815a0fe3f415e78ae8678fc1b8864e2dc34b9091
treeb85c9469d90e531c9b9df3f7efabd770dc14aa00
parent3cedeb691b74c1c0d85a7241727ad5e62ba53b4e
io-wq: fix bug of creating io-wokers unconditionally

[ Upstream commit 49e7f0c789add1330b111af0b7caeb0e87df063e ]

The former patch to add check between nr_workers and max_workers has a
bug, which will cause unconditionally creating io-workers. That's
because the result of the check doesn't affect the call of
create_io_worker(), fix it by bringing in a boolean value for it.

Fixes: 21698274da5b ("io-wq: fix lack of acct->nr_workers < acct->max_workers judgement")
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20210808135434.68667-2-haoxu@linux.alibaba.com
[axboe: drop hunk that isn't strictly needed]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io-wq.c