linux-stable/block/partitions
Li Lingfeng 3bc801ce9d block: Move checking GENHD_FL_NO_PART to bdev_add_partition()
[ Upstream commit 7777f47f2e ]

Commit 1a721de848 ("block: don't add or resize partition on the disk
with GENHD_FL_NO_PART") prevented all operations about partitions on disks
with GENHD_FL_NO_PART in blkpg_do_ioctl() since they are meaningless.
However, it changed error code in some scenarios. So move checking
GENHD_FL_NO_PART to bdev_add_partition() to eliminate impact.

Fixes: 1a721de848 ("block: don't add or resize partition on the disk with GENHD_FL_NO_PART")
Reported-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
Closes: https://lore.kernel.org/all/CAOYeF9VsmqKMcQjo1k6YkGNujwN-nzfxY17N3F-CMikE1tYp+w@mail.gmail.com/
Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240118130401.792757-1-lilingfeng@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 08:54:35 +01:00
..
Kconfig block: remove cmdline-parser.c 2021-08-02 13:37:28 -06:00
Makefile block: merge partition-generic.c and check.c 2020-03-24 07:57:08 -06:00
acorn.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
aix.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
amiga.c block/partition: fix signedness issue for Amiga partitions 2023-07-23 13:47:37 +02:00
atari.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
atari.h block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
check.h block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
cmdline.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
core.c block: Move checking GENHD_FL_NO_PART to bdev_add_partition() 2024-02-23 08:54:35 +01:00
efi.c partitions/efi: Support non-standard GPT location 2021-08-24 10:09:06 -06:00
efi.h Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-30 16:13:08 -07:00
ibm.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
karma.c block: remove block/partitions/karma.h 2020-03-24 07:57:08 -06:00
ldm.c for-5.15/block-2021-08-30 2021-08-30 18:52:11 -07:00
ldm.h partitions: msdos: fix one-byte get_unaligned() 2021-05-17 13:30:29 +02:00
mac.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
mac.h block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
msdos.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
osf.c block: remove block/partitions/osf.h 2020-03-24 07:57:08 -06:00
sgi.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
sun.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
sysv68.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
ultrix.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00