WSL2-Linux-Kernel/block/partitions
Li Lingfeng 3bc801ce9d block: Move checking GENHD_FL_NO_PART to bdev_add_partition()
[ Upstream commit 7777f47f2ea64efd1016262e7b59fab34adfb869 ]

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
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
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
ibm.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
karma.c
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
msdos.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
osf.c
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
ultrix.c