sst-linux/drivers/block
Uday Shankar 6aae16a973 ublk: set_params: properly check if parameters can be applied
[ Upstream commit 5ac60242b0173be83709603ebaf27a473f16c4e4 ]

The parameters set by the set_params call are only applied to the block
device in the start_dev call. So if a device has already been started, a
subsequently issued set_params on that device will not have the desired
effect, and should return an error. There is an existing check for this
- set_params fails on devices in the LIVE state. But this check is not
sufficient to cover the recovery case. In this case, the device will be
in the QUIESCED or FAIL_IO states, so set_params will succeed. But this
success is misleading, because the parameters will not be applied, since
the device has already been started (by a previous ublk server). The bit
UB_STATE_USED is set on completion of the start_dev; use it to detect
and fail set_params commands which arrive too late to be applied (after
start_dev).

Signed-off-by: Uday Shankar <ushankar@purestorage.com>
Fixes: 0aa73170eb ("ublk_drv: add SET_PARAMS/GET_PARAMS control command")
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250304-set_params-v1-1-17b5e0887606@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-03-13 12:53:18 +01:00
..
aoe
drbd
mtip32xx
null_blk null_blk: Fix return value of nullb_device_power_store() 2024-11-22 15:37:35 +01:00
paride
rnbd
xen-blkback
zram zram: fix potential UAF of zram table 2025-01-23 17:17:13 +01:00
amiflop.c
ataflop.c
brd.c brd: defer automatic disk creation until module initialization succeeds 2024-12-14 19:53:14 +01:00
floppy.c
Kconfig
loop.c
Makefile
n64cart.c
nbd.c nbd: don't allow reconnect after disconnect 2025-02-21 13:48:53 +01:00
pktcdvd.c
ps3disk.c
ps3vram.c
rbd_types.h
rbd.c
sunvdc.c
swim3.c
swim_asm.S
swim.c
ublk_drv.c ublk: set_params: properly check if parameters can be applied 2025-03-13 12:53:18 +01:00
virtio_blk.c virtio-blk: don't keep queue frozen during system suspend 2025-01-02 10:30:52 +01:00
xen-blkfront.c
z2ram.c