ublk: fail to recover device if queue setup is interrupted
authorMing Lei <ming.lei@redhat.com>
Wed, 26 Jul 2023 14:45:01 +0000 (22:45 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 27 Jul 2023 13:17:36 +0000 (07:17 -0600)
commit0c0cbd4ebc375ceebc75c89df04b74f215fab23a
treee4855ee85164efa5e1aebc9329e8634f0c11fab3
parent53e7d08f6d6e214c40db1f51291bb2975c789dc2
ublk: fail to recover device if queue setup is interrupted

In ublk_ctrl_end_recovery(), if wait_for_completion_interruptible() is
interrupted by signal, queues aren't setup successfully yet, so we
have to fail UBLK_CMD_END_USER_RECOVERY, otherwise kernel oops can be
triggered.

Fixes: c732a852b419 ("ublk_drv: add START_USER_RECOVERY and END_USER_RECOVERY support")
Reported-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20230726144502.566785-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c