Skip to content

Commit bed9e27

Browse files
biger410liu-song-6
authored andcommitted
Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"
This reverts commit 5e2cf33. That commit introduced the following race and can cause system hung. md_write_start: raid5d: // mddev->in_sync == 1 set "MD_SB_CHANGE_PENDING" // running before md_write_start wakeup it waiting "MD_SB_CHANGE_PENDING" cleared >>>>>>>>> hung wakeup mddev->thread ... waiting "MD_SB_CHANGE_PENDING" cleared >>>> hung, raid5d should clear this flag but get hung by same flag. The issue reverted commit fixing is fixed by last patch in a new way. Fixes: 5e2cf33 ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") Cc: [email protected] # v5.19+ Signed-off-by: Junxiao Bi <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Signed-off-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d6e035a commit bed9e27

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

drivers/md/raid5.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
*/
3737

3838
#include <linux/blkdev.h>
39-
#include <linux/delay.h>
4039
#include <linux/kthread.h>
4140
#include <linux/raid/pq.h>
4241
#include <linux/async_tx.h>
@@ -6820,18 +6819,7 @@ static void raid5d(struct md_thread *thread)
68206819
spin_unlock_irq(&conf->device_lock);
68216820
md_check_recovery(mddev);
68226821
spin_lock_irq(&conf->device_lock);
6823-
6824-
/*
6825-
* Waiting on MD_SB_CHANGE_PENDING below may deadlock
6826-
* seeing md_check_recovery() is needed to clear
6827-
* the flag when using mdmon.
6828-
*/
6829-
continue;
68306822
}
6831-
6832-
wait_event_lock_irq(mddev->sb_wait,
6833-
!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags),
6834-
conf->device_lock);
68356823
}
68366824
pr_debug("%d stripes handled\n", handled);
68376825

0 commit comments

Comments
 (0)