Patch "md: Don't wait for MD_RECOVERY_NEEDED for HOT_REMOVE_DISK ioctl" has been added to the 6.6-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: Don't wait for MD_RECOVERY_NEEDED for HOT_REMOVE_DISK ioctl

to the 6.6-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-don-t-wait-for-md_recovery_needed-for-hot_remove_.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 401d4997b93b04f3d421940a9031260756f66db1
Author: Yu Kuai <yukuai3@xxxxxxxxxx>
Date:   Thu Jun 27 19:23:21 2024 +0800

    md: Don't wait for MD_RECOVERY_NEEDED for HOT_REMOVE_DISK ioctl
    
    [ Upstream commit a1fd37f97808db4fa1bf55da0275790c42521e45 ]
    
    Commit 90f5f7ad4f38 ("md: Wait for md_check_recovery before attempting
    device removal.") explained in the commit message that failed device
    must be reomoved from the personality first by md_check_recovery(),
    before it can be removed from the array. That's the reason the commit
    add the code to wait for MD_RECOVERY_NEEDED.
    
    However, this is not the case now, because remove_and_add_spares() is
    called directly from hot_remove_disk() from ioctl path, hence failed
    device(marked faulty) can be removed from the personality by ioctl.
    
    On the other hand, the commit introduced a performance problem that
    if MD_RECOVERY_NEEDED is set and the array is not running, ioctl will
    wait for 5s before it can return failure to user.
    
    Since the waiting is not needed now, fix the problem by removing the
    waiting.
    
    Fixes: 90f5f7ad4f38 ("md: Wait for md_check_recovery before attempting device removal.")
    Reported-by: Mateusz Kusiak <mateusz.kusiak@xxxxxxxxxxxxxxx>
    Closes: https://lore.kernel.org/all/814ff6ee-47a2-4ba0-963e-cf256ee4ecfa@xxxxxxxxxxxxxxx/
    Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Signed-off-by: Song Liu <song@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240627112321.3044744-1-yukuai1@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/md.c b/drivers/md/md.c
index ba732b1d00b5b..b5dea664f946d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7684,12 +7684,6 @@ static int md_ioctl(struct block_device *bdev, blk_mode_t mode,
 
 	}
 
-	if (cmd == HOT_REMOVE_DISK)
-		/* need to ensure recovery thread has run */
-		wait_event_interruptible_timeout(mddev->sb_wait,
-						 !test_bit(MD_RECOVERY_NEEDED,
-							   &mddev->recovery),
-						 msecs_to_jiffies(5000));
 	if (cmd == STOP_ARRAY || cmd == STOP_ARRAY_RO) {
 		/* Need to flush page cache, and ensure no-one else opens
 		 * and writes




[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