lkml.org 
[lkml]   [2022]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 9/9] ublk_drv: do not schedule monitor_work with recovery feature enabled
    Date
    monitor_work is used to end(abort) all dying ubqs and cleanup device.
    With recovery feature enabled, we reinit dying ubqs in
    START_USER_RECOVERY command and we do not cleanup ublk device. So
    scheduling monitor_work in START_DEV is unnecessary.

    We manually schedule monitor_work in STOP_DEV regardless reocvery
    feature is enabled or not. So we can cleanup everything in the end.

    Signed-off-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
    ---
    drivers/block/ublk_drv.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
    index ccaf3761de74..f8bb2e818d33 100644
    --- a/drivers/block/ublk_drv.c
    +++ b/drivers/block/ublk_drv.c
    @@ -1435,7 +1435,8 @@ static int ublk_ctrl_start_dev(struct io_uring_cmd *cmd)

    wait_for_completion_interruptible(&ub->completion);

    - schedule_delayed_work(&ub->monitor_work, UBLK_DAEMON_MONITOR_PERIOD);
    + if (!ublk_can_use_recovery(ub))
    + schedule_delayed_work(&ub->monitor_work, UBLK_DAEMON_MONITOR_PERIOD);

    mutex_lock(&ub->mutex);
    if (ub->dev_info.state != UBLK_S_DEV_DEAD ||
    --
    2.27.0
    \
     
     \ /
      Last update: 2022-08-24 07:50    [W:4.774 / U:0.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site