mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
ublk: return -EINTR if breaking from waiting for existed users in DEL_DEV
If user interrupts wait_event_interruptible() in ublk_ctrl_del_dev(),
return -EINTR and let user know what happens.
Fixes: 0abe39dec0
("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>
This commit is contained in:
parent
0c0cbd4ebc
commit
3e9dce80db
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user