original_kernel/block
Shin'ichiro Kawasaki b53df2e744 block: Fix partition support for host aware zoned block devices
Commit b72053072c ("block: allow partitions on host aware zone
devices") introduced the helper function disk_has_partitions() to check
if a given disk has valid partitions. However, since this function result
directly depends on the disk partition table length rather than the
actual existence of valid partitions in the table, it returns true even
after all partitions are removed from the disk. For host aware zoned
block devices, this results in zone management support to be kept
disabled even after removing all partitions.

Fix this by changing disk_has_partitions() to walk through the partition
table entries and return true if and only if a valid non-zero size
partition is found.

Fixes: b72053072c ("block: allow partitions on host aware zone devices")
Cc: stable@vger.kernel.org # 5.5
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-12 07:54:39 -06:00
..
partitions partitions/ldm: fix spelling mistake "to" -> "too" 2020-01-23 11:41:45 -07:00
Kconfig
Kconfig.iosched
Makefile SCSI misc on 20200129 2020-01-29 18:16:16 -08:00
badblocks.c
bfq-cgroup.c block, bfq: fix overwrite of bfq_group pointer in bfq_find_set_group() 2020-03-06 07:00:58 -07:00
bfq-iosched.c block, bfq: clarify the goal of bfq_split_bfqq() 2020-02-03 06:58:15 -07:00
bfq-iosched.h block, bfq: get a ref to a group when adding it to a service tree 2020-02-03 06:58:15 -07:00
bfq-wf2q.c block, bfq: get a ref to a group when adding it to a service tree 2020-02-03 06:58:15 -07:00
bio-integrity.c
bio.c fs: move guard_bio_eod() after bio_set_op_attrs 2020-01-09 08:16:12 -07:00
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c
blk-core.c block: Remove used kblockd_schedule_work_on() 2020-03-02 07:17:31 -07:00
blk-exec.c
blk-flush.c blk-mq: insert passthrough request into hctx->dispatch directly 2020-02-24 18:50:48 -07:00
blk-integrity.c
blk-ioc.c
blk-iocost.c blk-iocost: fix incorrect vtime comparison in iocg_is_idle() 2020-03-10 11:37:00 -06:00
blk-iolatency.c
blk-lib.c
blk-map.c
blk-merge.c block: fix get_max_segment_size() overflow on 32bit arch 2020-01-14 13:37:40 -07:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: insert flush request to the front of dispatch queue 2020-03-12 07:26:12 -06:00
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c blk-mq: Remove some unused function arguments 2020-02-26 10:34:41 -07:00
blk-mq-tag.h blk-mq: Remove some unused function arguments 2020-02-26 10:34:41 -07:00
blk-mq-virtio.c
blk-mq.c blk-mq: Remove some unused function arguments 2020-02-26 10:34:41 -07:00
blk-mq.h blk-mq: Remove some unused function arguments 2020-02-26 10:34:41 -07:00
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c block: fix an integer overflow in logical block size 2020-01-15 21:43:09 -07:00
blk-softirq.c
blk-stat.c
blk-stat.h
blk-sysfs.c
blk-throttle.c
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c block: mark zone-mgmt bios with REQ_SYNC 2020-01-09 07:59:12 -07:00
blk.h
bounce.c
bsg-lib.c
bsg.c
cmdline-parser.c
elevator.c
genhd.c block: Fix partition support for host aware zoned block devices 2020-03-12 07:54:39 -06:00
ioctl.c
ioprio.c
kyber-iosched.c
mq-deadline.c
opal_proto.h
partition-generic.c block: allow partitions on host aware zone devices 2020-01-26 09:59:08 -07:00
scsi_ioctl.c
sed-opal.c
t10-pi.c