aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2022-06-08 10:27:49 -0600
committerJens Axboe <axboe@kernel.dk>2022-08-02 17:14:31 -0600
commitc629f345b436997e4483aff85ec93f32faf6e4e6 (patch)
tree8f60082b9c522fbd2182f5e63a6bf80f38d10908 /drivers/md/raid5.c
parentmd/raid5-ppl: Drop unused argument from ppl_handle_flush_request() (diff)
downloadlinux-dev-c629f345b436997e4483aff85ec93f32faf6e4e6.tar.xz
linux-dev-c629f345b436997e4483aff85ec93f32faf6e4e6.zip
md/raid5: suspend the array for calls to log_exit()
The raid5-cache code relies on there being no IO in flight when log_exit() is called. There are two places where this is not guaranteed so add mddev_suspend() and mddev_resume() calls to these sites. The site in raid5_change_consistency_policy() is in the error path, and another similar call site already has suspend/resume calls just below it; so it should be equally safe to make that change here. There is one remaining site in raid5_remove_disk() that we call log_exit() without suspending the array. Unfortunately, as the comment stated, we cannot call mddev_suspend from raid5d. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Song Liu <song@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 5cabdbbac48b..9950f576a34e 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -8704,8 +8704,11 @@ static int raid5_change_consistency_policy(struct mddev *mddev, const char *buf)
err = log_init(conf, NULL, true);
if (!err) {
err = resize_stripes(conf, conf->pool_size);
- if (err)
+ if (err) {
+ mddev_suspend(mddev);
log_exit(conf);
+ mddev_resume(mddev);
+ }
}
} else
err = -EINVAL;