Patch "ublk: return -EINTR if breaking from waiting for existed users in DEL_DEV" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ublk: return -EINTR if breaking from waiting for existed users in DEL_DEV

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ublk-return-eintr-if-breaking-from-waiting-for-exist.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fc597c74eb5fe96949c16d8cbcaf649debc43fd5
Author: Ming Lei <ming.lei@xxxxxxxxxx>
Date:   Wed Jul 26 22:45:02 2023 +0800

    ublk: return -EINTR if breaking from waiting for existed users in DEL_DEV
    
    [ Upstream commit 3e9dce80dbf91972aed972c743f539c396a34312 ]
    
    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@xxxxxxxxxx>
    Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>
    Reviewed-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230726144502.566785-4-ming.lei@xxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index bf0711894c0a2..e6b6e5eee4dea 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -1909,8 +1909,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;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux