linux-stable/block
Li Lingfeng 072cd213c6 block: don't add or resize partition on the disk with GENHD_FL_NO_PART
[ Upstream commit 1a721de848 ]

Commit a33df75c63 ("block: use an xarray for disk->part_tbl") remove
disk_expand_part_tbl() in add_partition(), which means all kinds of
devices will support extended dynamic `dev_t`.
However, some devices with GENHD_FL_NO_PART are not expected to add or
resize partition.
Fix this by adding check of GENHD_FL_NO_PART before add or resize
partition.

Fixes: a33df75c63 ("block: use an xarray for disk->part_tbl")
Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230831075900.1725842-1-lilingfeng@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:23:03 +02:00
..
partitions block: move GENHD_FL_NATIVE_CAPACITY to disk->state 2023-09-19 12:23:02 +02:00
badblocks.c
bdev.c block: move GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE to disk->event_flags 2023-09-19 12:23:02 +02:00
bfq-cgroup.c block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-02-09 11:26:36 +01:00
bfq-iosched.c block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-02-09 11:26:36 +01:00
bfq-iosched.h bfq: Get rid of __bio_blkcg() usage 2022-06-09 10:23:19 +02:00
bfq-wf2q.c block/bfq_wf2q: correct weight to ioprio 2022-04-08 14:23:55 +02:00
bio-integrity.c block: bio-integrity: Copy flags when bio_integrity_payload is cloned 2023-03-10 09:39:05 +01:00
bio.c block: ensure iov_iter advances for added pages 2022-08-17 14:24:01 +02:00
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c blk-cgroup: fix missing pd_online_fn() while activating policy 2023-02-06 07:59:00 +01:00
blk-core.c blk-mq: release crypto keyslot before reporting I/O complete 2023-05-11 23:00:16 +09:00
blk-crypto-fallback.c
blk-crypto-internal.h blk-mq: release crypto keyslot before reporting I/O complete 2023-05-11 23:00:16 +09:00
blk-crypto.c blk-crypto: make blk_crypto_evict_key() more robust 2023-05-11 23:00:16 +09:00
blk-exec.c
blk-flush.c block: Fix fsync always failed if once failed 2022-01-27 11:05:25 +01:00
blk-integrity.c block: flush the integrity workqueue in blk_integrity_unregister 2021-09-14 20:03:30 -06:00
blk-ioc.c block: fix default IO priority handling again 2022-08-11 13:07:50 +02:00
blk-iocost.c blk-iocost: use spin_lock_irqsave in adjust_inuse_and_calc_cost 2023-07-23 13:46:44 +02:00
blk-iolatency.c block: don't allow the same type rq_qos add more than once 2022-08-17 14:24:24 +02:00
blk-ioprio.c
blk-ioprio.h
blk-lib.c
blk-map.c block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern 2022-03-08 19:12:31 +01:00
blk-merge.c blk-mq: release crypto keyslot before reporting I/O complete 2023-05-11 23:00:16 +09:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created 2022-08-17 14:23:12 +02:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: correct stale comment of .get_budget 2023-03-10 09:39:04 +01:00
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: fix possible memleak when register 'hctx' failed 2022-12-31 13:14:43 +01:00
blk-mq-tag.c blk-mq: avoid to iterate over stale request 2021-09-12 19:32:43 -06:00
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c blk-mq: release crypto keyslot before reporting I/O complete 2023-05-11 23:00:16 +09:00
blk-mq.h blk-mq: cancel blk-mq dispatch work in both blk_cleanup_queue and disk_release() 2021-12-01 09:04:56 +01:00
blk-pm.c scsi: block: pm: Always set request queue runtime active in blk_post_runtime_resume() 2022-01-27 11:04:15 +01:00
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h block: don't allow the same type rq_qos add more than once 2022-08-17 14:24:24 +02:00
blk-settings.c block: fix revalidate performance regression 2023-06-09 10:32:32 +02:00
blk-stat.c
blk-stat.h
blk-sysfs.c block: don't delete queue kobject before its children 2022-04-08 14:23:07 +02:00
blk-throttle.c blk-throttle: prevent overflow while calculating wait time 2022-10-26 12:35:47 +02:00
blk-timeout.c
blk-wbt.c blk-wbt: fix that 'rwb->wc' is always set to 1 in wbt_init() 2022-10-26 12:35:54 +02:00
blk-wbt.h
blk-zoned.c block: Hold invalidate_lock in BLKRESETZONE ioctl 2021-11-18 19:17:15 +01:00
blk.h block: bump max plugged deferred size from 16 to 32 2021-11-18 19:16:16 +01:00
bounce.c
bsg-lib.c
bsg.c scsi: bsg: Fix device unregistration 2021-09-14 00:22:15 -04:00
disk-events.c block: increment diskseq on all media change events 2023-07-23 13:47:20 +02:00
elevator.c block/wbt: fix negative inflight counter when remove scsi device 2022-02-23 12:03:15 +01:00
fops.c block: don't allow multiple bios for IOCB_NOWAIT issue 2023-03-10 09:39:55 +01:00
genhd.c block: rename GENHD_FL_NO_PART_SCAN to GENHD_FL_NO_PART 2023-09-19 12:23:02 +02:00
holder.c block: drop unused includes in <linux/genhd.h> 2022-03-16 14:23:46 +01:00
ioctl.c block: don't add or resize partition on the disk with GENHD_FL_NO_PART 2023-09-19 12:23:03 +02:00
ioprio.c block: fix default IO priority handling again 2022-08-11 13:07:50 +02:00
Kconfig
Kconfig.iosched
keyslot-manager.c blk-crypto: make blk_crypto_evict_key() more robust 2023-05-11 23:00:16 +09:00
kyber-iosched.c kyber: avoid q->disk dereferences in trace points 2021-10-15 21:02:57 -06:00
Makefile block: move CONFIG_BLOCK guard to top Makefile 2022-12-14 11:37:30 +01:00
mq-deadline.c block: mq-deadline: Rename deadline_is_seq_writes() 2023-01-24 07:22:49 +01:00
opal_proto.h
sed-opal.c block: sed-opal: kmalloc the cmd/resp buffers 2022-11-26 09:24:35 +01:00
t10-pi.c