Skip to content

Commit 3e9dce8

Browse files
Ming Leiaxboe
authored andcommitted
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: 0abe39d ("block: ublk: improve handling device deletion") Reported-by: Stefano Garzarella <[email protected]> Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 0c0cbd4 commit 3e9dce8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/ublk_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,8 +2126,8 @@ static int ublk_ctrl_del_dev(struct ublk_device **p_ub)
21262126
* - the device number is freed already, we will not find this
21272127
* device via ublk_get_device_from_id()
21282128
*/
2129-
wait_event_interruptible(ublk_idr_wq, ublk_idr_freed(idx));
2130-
2129+
if (wait_event_interruptible(ublk_idr_wq, ublk_idr_freed(idx)))
2130+
return -EINTR;
21312131
return 0;
21322132
}
21332133

0 commit comments

Comments
 (0)