Patch "floppy: Fix hang in watchdog when disk is ejected" has been added to the 5.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

    floppy: Fix hang in watchdog when disk is ejected

to the 5.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:
     floppy-fix-hang-in-watchdog-when-disk-is-ejected.patch
and it can be found in the queue-5.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 e1f35bee7a18c8949a76ecd5769c9563566e89a6
Author: Tasos Sahanidis <tasos@xxxxxxxxxxxx>
Date:   Fri Sep 3 09:47:58 2021 +0300

    floppy: Fix hang in watchdog when disk is ejected
    
    [ Upstream commit fb48febce7e30baed94dd791e19521abd2c3fd83 ]
    
    When the watchdog detects a disk change, it calls cancel_activity(),
    which in turn tries to cancel the fd_timer delayed work.
    
    In the above scenario, fd_timer_fn is set to fd_watchdog(), meaning
    it is trying to cancel its own work.
    This results in a hang as cancel_delayed_work_sync() is waiting for the
    watchdog (itself) to return, which never happens.
    
    This can be reproduced relatively consistently by attempting to read a
    broken floppy, and ejecting it while IO is being attempted and retried.
    
    To resolve this, this patch calls cancel_delayed_work() instead, which
    cancels the work without waiting for the watchdog to return and finish.
    
    Before this regression was introduced, the code in this section used
    del_timer(), and not del_timer_sync() to delete the watchdog timer.
    
    Link: https://lore.kernel.org/r/399e486c-6540-db27-76aa-7a271b061f76@xxxxxxxxxxxx
    Fixes: 070ad7e793dc ("floppy: convert to delayed work and single-thread wq")
    Signed-off-by: Tasos Sahanidis <tasos@xxxxxxxxxxxx>
    Signed-off-by: Denis Efremov <efremov@xxxxxxxxx>
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index ac97a1e2e5ddc..212a1e1ce0d9e 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -1003,7 +1003,7 @@ static DECLARE_DELAYED_WORK(fd_timer, fd_timer_workfn);
 static void cancel_activity(void)
 {
 	do_floppy = NULL;
-	cancel_delayed_work_sync(&fd_timer);
+	cancel_delayed_work(&fd_timer);
 	cancel_work_sync(&floppy_work);
 }
 



[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