Skip to content

Commit 3445139

Browse files
committed
Revert "Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d""
This reverts commit bed9e27. The original set [1][2] was expected to undo a suboptimal fix in [2], and replace it with a better fix [1]. However, as reported by Dan Moulding [2] causes an issue with raid5 with journal device. Revert [2] for now to close the issue. We will follow up on another issue reported by Juxiao Bi, as [2] is expected to fix it. We believe this is a good trade-off, because the latter issue happens less freqently. In the meanwhile, we will NOT revert [1], as it contains the right logic. [1] commit d6e035a ("md: bypass block throttle for superblock update") [2] commit bed9e27 ("Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"") Reported-by: Dan Moulding <[email protected]> Closes: https://lore.kernel.org/linux-raid/[email protected]/ Fixes: bed9e27 ("Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"") Cc: [email protected] # v5.19+ Cc: Junxiao Bi <[email protected]> Cc: Yu Kuai <[email protected]> Signed-off-by: Song Liu <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2682832 commit 3445139

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/md/raid5.c

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

3838
#include <linux/blkdev.h>
39+
#include <linux/delay.h>
3940
#include <linux/kthread.h>
4041
#include <linux/raid/pq.h>
4142
#include <linux/async_tx.h>
@@ -6764,7 +6765,18 @@ static void raid5d(struct md_thread *thread)
67646765
spin_unlock_irq(&conf->device_lock);
67656766
md_check_recovery(mddev);
67666767
spin_lock_irq(&conf->device_lock);
6768+
6769+
/*
6770+
* Waiting on MD_SB_CHANGE_PENDING below may deadlock
6771+
* seeing md_check_recovery() is needed to clear
6772+
* the flag when using mdmon.
6773+
*/
6774+
continue;
67676775
}
6776+
6777+
wait_event_lock_irq(mddev->sb_wait,
6778+
!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags),
6779+
conf->device_lock);
67686780
}
67696781
pr_debug("%d stripes handled\n", handled);
67706782

0 commit comments

Comments
 (0)