nbd: Respect max_part for all partition scans
authorJosh Triplett <josh@joshtriplett.org>
Thu, 17 Dec 2020 08:58:47 +0000 (00:58 -0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Dec 2020 14:54:51 +0000 (07:54 -0700)
commit1aba169e770911fb2afa63eb859883c4de2191e3
tree47667f78d1afad25b8102b0871083489bc867e4d
parent9aaf9a2aba0c2b5f0fc6dfeb011f0b4c8e224a73
nbd: Respect max_part for all partition scans

The creation path of the NBD device respects max_part and only scans for
partitions if max_part is not 0. However, some other code paths ignore
max_part, and unconditionally scan for partitions. Add a check for
max_part on each partition scan.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c