diff options
author | Ming Lei <ming.lei@redhat.com> | 2023-07-26 17:45:02 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-07-27 16:17:36 +0300 |
commit | 3e9dce80dbf91972aed972c743f539c396a34312 (patch) | |
tree | a2f03af3a060d04df4e6bb091f3becd82bb68030 /drivers | |
parent | 0c0cbd4ebc375ceebc75c89df04b74f215fab23a (diff) | |
download | linux-3e9dce80dbf91972aed972c743f539c396a34312.tar.xz |
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: 0abe39dec065 ("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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/ublk_drv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 9fcba3834e8d..21d2e71c5514 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -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; } |