md: replace is_md_suspended() with 'mddev->suspended' in md_check_recovery()
authorYu Kuai <yukuai3@huawei.com>
Tue, 10 Oct 2023 15:19:42 +0000 (23:19 +0800)
committerSong Liu <song@kernel.org>
Wed, 11 Oct 2023 01:49:49 +0000 (18:49 -0700)
Prepare to cleanup pers->prepare_suspend(), which is used to fix a
deadlock in raid456 by returning error for io that is waiting for
reshape to make progress in mddev_suspend().

This change will allow reshape to make progress while waiting for io to
be done in mddev_suspend() in following patches.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231010151958.145896-4-yukuai1@huaweicloud.com
drivers/md/md.c

index 930bcabeec79a367de1e3dd61f3717aee90cf063..cf929c42cdbe3a0d2c7b13ba79d120dad21e0184 100644 (file)
@@ -9418,7 +9418,7 @@ void md_check_recovery(struct mddev *mddev)
                wake_up(&mddev->sb_wait);
        }
 
-       if (is_md_suspended(mddev))
+       if (READ_ONCE(mddev->suspended))
                return;
 
        if (mddev->bitmap)