raid10_start_reshape() can fail while resizing a bitmap before it
changes any recovery bits on its success path. Its abort path nevertheless
clears the entire mddev->recovery bitmap.
dm-raid keeps MD_RECOVERY_FROZEN set across suspend and resume. If RAID10
reshape setup fails, raid_preresume() logs the failure and continues with
resume. Clearing the bitmap removes MD_RECOVERY_FROZEN and makes
raid_resume() hit its invariant warning.
Do not clear mddev->recovery from the RAID10 abort path. The error paths
reach abort before raid10_start_reshape() modifies the recovery bits, so
there is no personality-owned recovery state to roll back there.
Fixes: bb63a7019df9 ("md/raid10: resize bitmap when required during reshape.")
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=8b22a0459202f76b4096
Signed-off-by: Hristos Nenkov <[email protected]>
---
drivers/md/raid10.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 066c43154..1fd3f5f4f 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -4490,7 +4490,6 @@ static int raid10_start_reshape(struct mddev *mddev)
return 0;
abort:
- mddev->recovery = 0;
spin_lock_irq(&conf->device_lock);
conf->geo = conf->prev;
mddev->raid_disks = conf->geo.raid_disks;
base-commit: b3dfbde62cf1981c4638939c159dfd087b7a72e9
--
2.43.0