Zhong Jinghua 4a2c62c8d6 nbd: Add the maximum limit of allocated index in nbd_dev_add
[ Upstream commit f12bc113ce904777fd6ca003b473b427782b3dde ]

If the index allocated by idr_alloc greater than MINORMASK >> part_shift,
the device number will overflow, resulting in failure to create a block
device.

Fix it by imiting the size of the max allocation.

Signed-off-by: Zhong Jinghua <zhongjinghua@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230605122159.2134384-1-zhongjinghua@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:44:36 +02:00
..
2020-09-10 09:32:30 -06:00
2020-09-10 09:32:30 -06:00
2023-06-14 11:09:30 +02:00
2023-06-14 11:09:30 +02:00
2020-09-10 09:32:31 -06:00
2020-09-10 09:32:30 -06:00