md/raid5: suspend the array for calls to log_exit()
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 8 Jun 2022 16:27:49 +0000 (10:27 -0600)
committerSong Liu <song@kernel.org>
Sun, 3 Jul 2022 14:55:37 +0000 (07:55 -0700)
commitf4eb3eb3a9d522ec7073cdfa3dc87facca585b08
tree2d3f6be4b22bde0340bb22070e267d4c6cfe6504
parent26becbe46497e4161dd486bec66a8e444056e0d8
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>
drivers/md/raid5.c