linux-stable/drivers/block
Christoph Hellwig d31b82b7f0 block, loop: support partitions without scanning
commit b9684a71fc upstream.

Historically we did distinguish between a flag that surpressed partition
scanning, and a combinations of the minors variable and another flag if
any partitions were supported.  This was generally confusing and doesn't
make much sense, but some corner case uses of the loop driver actually
do want to support manually added partitions on a device that does not
actively scan for partitions.  To make things worsee the loop driver
also wants to dynamically toggle the scanning for partitions on a live
gendisk, which makes the disk->flags updates non-atomic.

Introduce a new GD_SUPPRESS_PART_SCAN bit in disk->state that disables
just scanning for partitions, and toggle that instead of GENHD_FL_NO_PART
in the loop driver.

Fixes: 1ebe2e5f9d ("block: remove GENHD_FL_EXT_DEVT")
Reported-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220527055806.1972352-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-14 18:41:52 +02:00
..
aoe aoe: remove redundant assignment on variable n 2022-01-13 13:00:45 -07:00
drbd drbd: fix duplicate array initializer 2022-06-09 10:25:40 +02:00
mtip32xx block: fix surprise removal for drivers calling blk_set_queue_dying 2022-02-17 07:54:03 -07:00
null_blk block: null_blk: end timed out poll request 2022-04-20 09:36:18 +02:00
paride Char/Misc and other driver changes for 5.17-rc1 2022-01-14 16:02:28 +01:00
rnbd bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
xen-blkback block: remove GENHD_FL_CD 2021-11-29 06:35:21 -07:00
zram Merge branch 'akpm' (patches from Andrew) 2022-01-15 20:37:06 +02:00
Kconfig floppy: disable FDRAWCMD by default 2022-05-09 09:16:11 +02:00
Makefile block: remove the rsxx driver 2021-12-16 10:57:04 -07:00
amiflop.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
ataflop.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
brd.c brd: remove brd_devices_mutex mutex 2022-01-17 07:19:40 -07:00
floppy.c floppy: use a statically allocated error counter 2022-05-25 09:58:56 +02:00
loop.c block, loop: support partitions without scanning 2022-06-14 18:41:52 +02:00
loop.h loop: revert "make autoclear operation asynchronous" 2022-02-11 05:51:23 -07:00
n64cart.c n64cart: convert bi_disk to bi_bdev->bd_disk fix build 2022-04-08 13:59:04 +02:00
nbd.c nbd: fix io hung while disconnecting device 2022-06-14 18:41:40 +02:00
pktcdvd.c pktcdvd: convert to use attribute groups 2022-01-03 21:24:34 -07:00
ps3disk.c ps3disk: add error handling support for add_disk() 2021-10-30 11:03:37 -06:00
ps3vram.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
rbd.c block: fix surprise removal for drivers calling blk_set_queue_dying 2022-02-17 07:54:03 -07:00
rbd_types.h
sunvdc.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
swim.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
swim3.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00
swim_asm.S
sx8.c block: remove the gendisk argument to blk_execute_rq 2021-11-29 06:41:29 -07:00
virtio_blk.c virtio_blk: fix the discard_granularity and discard_alignment queue limits 2022-06-09 10:25:46 +02:00
xen-blkfront.c xen/blkfront: don't use gnttab_query_foreign_access() for mapped status 2022-03-07 09:48:54 +01:00
z2ram.c block: remove GENHD_FL_EXT_DEVT 2021-11-29 06:38:35 -07:00