]> www.infradead.org Git - nvme.git/commit
ublk: Add UBLK_U_CMD_UPDATE_SIZE
authorOmri Mann <omri@nvidia.com>
Mon, 21 Apr 2025 10:59:50 +0000 (13:59 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 21 Apr 2025 15:25:41 +0000 (09:25 -0600)
commit98b995660bff011d8e00af03abd74ac7d1ac1390
tree62feac730bd053a08e406a87c52167b7a6a6a577
parent033b667a823ee403509e7156bc7fa335bd566bff
ublk: Add UBLK_U_CMD_UPDATE_SIZE

Currently ublk only allows the size of the ublkb block device to be
set via UBLK_CMD_SET_PARAMS before UBLK_CMD_START_DEV is triggered.

This does not provide support for extendable user-space block devices
without having to stop and restart the underlying ublkb block device
causing IO interruption.

This patch adds a new ublk command UBLK_U_CMD_UPDATE_SIZE to allow the
ublk block device to be resized on-the-fly.

Feature flag UBLK_F_UPDATE_SIZE is also added to indicate support.

Signed-off-by: Omri Mann <omri@nvidia.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/2a370ab1-d85b-409d-b762-f9f3f6bdf705@nvidia.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c
include/uapi/linux/ublk_cmd.h