Re: [PATCH] block: move capacity validation to blkpg_do_ioctl()

From: Damien Le Moal
Date: Tue Mar 05 2024 - 02:06:57 EST


On 3/5/24 12:21, Li Lingfeng wrote:
> From: Li Lingfeng <lilingfeng3@xxxxxxxxxx>
>
> Commit 6d4e80db4ebe ("block: add capacity validation in
> bdev_add_partition()") add check of partition's start and end sectors to
> prevent exceeding the size of the disk when adding partitions. However,
> there is still no check for resizing partitions now.
> Move the check to blkpg_do_ioctl() to cover resizing partitions.
>
> Signed-off-by: Li Lingfeng <lilingfeng3@xxxxxxxxxx>

Looks good.

Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx>

But I wonder if this needs a Fixes: 6d4e80db4ebe ("block: add capacity
validation in bdev_add_partition()") tag and Cc-stable...

--
Damien Le Moal
Western Digital Research