summaryrefslogtreecommitdiff
path: root/block/blk-ioc.c
diff options
context:
space:
mode:
authorZhong Jinghua <zhongjinghua@huawei.com>2023-06-05 20:21:59 +0800
committerJens Axboe <axboe@kernel.dk>2023-06-07 07:50:48 -0600
commitf12bc113ce904777fd6ca003b473b427782b3dde (patch)
treedc0959ce6bb5f8d3116c864c844360332e1d6eb6 /block/blk-ioc.c
parentddf63516d8d37528dc6834c7f19b55084e956068 (diff)
nbd: Add the maximum limit of allocated index in nbd_dev_add
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>
Diffstat (limited to 'block/blk-ioc.c')
0 files changed, 0 insertions, 0 deletions