On Mon, Jan 12, 2026 at 08:52:31AM -0800, Caleb Sander Mateos wrote:
On Sun, Jan 11, 2026 at 8:12 PM Ming Lei ming.lei@redhat.com wrote:
When ublk_ctrl_start_dev() fails after waiting for completion, the device needs to be properly cancelled to prevent leaving it in an inconsistent state. Without this, pending I/O commands may remain uncompleted and the device cannot be cleanly removed.
Add ublk_cancel_dev() call in the error path to ensure proper cleanup when START_DEV fails.
It's not clear to me why the UBLK_IO_FETCH_REQ commands must be cancelled if UBLK_CMD_START_DEV fails. Wouldn't they get cancelled whenever the ublk device is deleted or the ublk server exits?
Good catch, DEL_DEV/STOP_DEV supposes to be capable of handling irrecoverable START_DEV failure.
So this patch isn't needed.
Thanks, Ming