Patch "md: do not delete safemode_timer in mddev_suspend" has been added to the 6.10-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

    md: do not delete safemode_timer in mddev_suspend

to the 6.10-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:
     md-do-not-delete-safemode_timer-in-mddev_suspend.patch
and it can be found in the queue-6.10 subdirectory.

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



commit b44ae01194d94f931c56978e6000e1674ea25cf6
Author: Li Nan <linan122@xxxxxxxxxx>
Date:   Wed May 8 17:20:53 2024 +0800

    md: do not delete safemode_timer in mddev_suspend
    
    [ Upstream commit a8768a134518e406d41799a3594aeb74e0889cf7 ]
    
    The deletion of safemode_timer in mddev_suspend() is redundant and
    potentially harmful now. If timer is about to be woken up but gets
    deleted, 'in_sync' will remain 0 until the next write, causing array
    to stay in the 'active' state instead of transitioning to 'clean'.
    
    Commit 0d9f4f135eb6 ("MD: Add del_timer_sync to mddev_suspend (fix
    nasty panic))" introduced this deletion for dm, because if timer fired
    after dm is destroyed, the resource which the timer depends on might
    have been freed.
    
    However, commit 0dd84b319352 ("md: call __md_stop_writes in md_stop")
    added __md_stop_writes() to md_stop(), which is called before freeing
    resource. Timer is deleted in __md_stop_writes(), and the origin issue
    is resolved. Therefore, delete safemode_timer can be removed safely now.
    
    Signed-off-by: Li Nan <linan122@xxxxxxxxxx>
    Reviewed-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Signed-off-by: Song Liu <song@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240508092053.1447930-1-linan666@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9c5be016e5073..60a5fda7c8aea 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -479,7 +479,6 @@ int mddev_suspend(struct mddev *mddev, bool interruptible)
 	 */
 	WRITE_ONCE(mddev->suspended, mddev->suspended + 1);
 
-	del_timer_sync(&mddev->safemode_timer);
 	/* restrict memory reclaim I/O during raid array is suspend */
 	mddev->noio_flag = memalloc_noio_save();
 




[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