ublk: add feature UBLK_F_QUIESCE
authorMing Lei <ming.lei@redhat.com>
Thu, 22 May 2025 16:35:20 +0000 (00:35 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 23 May 2025 15:42:12 +0000 (09:42 -0600)
commitb465ae7b2524170cb14fa25dbcb84923bfb1a0a9
tree4758437e2824152b0edd6b0bb3c2a7eb62c67280
parentf40b1f2670f084d2879e4a125a75ff7788ec67ba
ublk: add feature UBLK_F_QUIESCE

Add feature UBLK_F_QUIESCE, which adds control command `UBLK_U_CMD_QUIESCE_DEV`
for quiescing device, then device state can become `UBLK_S_DEV_QUIESCED`
or `UBLK_S_DEV_FAIL_IO` finally from ublk_ch_release() with ublk server
cooperation.

This feature can help to support to upgrade ublk server application by
shutting down ublk server gracefully, meantime keep ublk block device
persistent during the upgrading period.

The feature is only available for UBLK_F_USER_RECOVERY.

Suggested-by: Yoav Cohen <yoav@nvidia.com>
Link: https://lore.kernel.org/linux-block/DM4PR12MB632807AB7CDCE77D1E5AB7D0A9B92@DM4PR12MB6328.namprd12.prod.outlook.com/
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250522163523.406289-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c
include/uapi/linux/ublk_cmd.h