summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunxiao Bi <junxiao.bi@oracle.com>2023-11-08 10:22:16 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-23 08:12:58 +0100
commit1e8c1c2a92692881ac7ec92dcf1c8a846584251b (patch)
tree200d22885612b4df4a8e7fb7ef677dd5fd6d9340
parent81c0229f34f0e1330789fae616b9e2219ab28477 (diff)
downloadlinux-stable-1e8c1c2a92692881ac7ec92dcf1c8a846584251b.tar.gz
linux-stable-1e8c1c2a92692881ac7ec92dcf1c8a846584251b.tar.bz2
linux-stable-1e8c1c2a92692881ac7ec92dcf1c8a846584251b.zip
Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"
[ Upstream commit bed9e27baf52a09b7ba2a3714f1e24e17ced386d ] This reverts commit 5e2cf333b7bd5d3e62595a44d598a254c697cd74. 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: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d") Cc: stable@vger.kernel.org # v5.19+ Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20231108182216.73611-2-junxiao.bi@oracle.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/md/raid5.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index b98abe927d06..e2fcc09a18cd 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -44,7 +44,6 @@
*/
#include <linux/blkdev.h>
-#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/raid/pq.h>
#include <linux/async_tx.h>
@@ -6330,18 +6329,7 @@ static void raid5d(struct md_thread *thread)
spin_unlock_irq(&conf->device_lock);
md_check_recovery(mddev);
spin_lock_irq(&conf->device_lock);
-
- /*
- * Waiting on MD_SB_CHANGE_PENDING below may deadlock
- * seeing md_check_recovery() is needed to clear
- * the flag when using mdmon.
- */
- continue;
}
-
- wait_event_lock_irq(mddev->sb_wait,
- !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags),
- conf->device_lock);
}
pr_debug("%d stripes handled\n", handled);