Skip to content

Commit

Permalink
ublk: return -EINTR if breaking from waiting for existed users in DEL…
Browse files Browse the repository at this point in the history
…_DEV

If user interrupts wait_event_interruptible() in ublk_ctrl_del_dev(),
return -EINTR and let user know what happens.

Fixes: 0abe39d ("block: ublk: improve handling device deletion")
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-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Ming Lei authored and axboe committed Jul 27, 2023
1 parent 0c0cbd4 commit 3e9dce8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/ublk_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2126,8 +2126,8 @@ static int ublk_ctrl_del_dev(struct ublk_device **p_ub)
* - the device number is freed already, we will not find this
* device via ublk_get_device_from_id()
*/
wait_event_interruptible(ublk_idr_wq, ublk_idr_freed(idx));

if (wait_event_interruptible(ublk_idr_wq, ublk_idr_freed(idx)))
return -EINTR;
return 0;
}

Expand Down

0 comments on commit 3e9dce8

Please sign in to comment.