File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -3803,6 +3803,23 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits)
3803
3803
blk_limits_io_opt (limits , chunk_size_bytes * mddev_data_stripes (rs ));
3804
3804
}
3805
3805
3806
+ static void raid_presuspend (struct dm_target * ti )
3807
+ {
3808
+ struct raid_set * rs = ti -> private ;
3809
+ struct mddev * mddev = & rs -> md ;
3810
+
3811
+ if (!reshape_interrupted (mddev ))
3812
+ return ;
3813
+
3814
+ /*
3815
+ * For raid456, if reshape is interrupted, IO across reshape position
3816
+ * will never make progress, while caller will wait for IO to be done.
3817
+ * Inform raid456 to handle those IO to prevent deadlock.
3818
+ */
3819
+ if (mddev -> pers && mddev -> pers -> prepare_suspend )
3820
+ mddev -> pers -> prepare_suspend (mddev );
3821
+ }
3822
+
3806
3823
static void raid_postsuspend (struct dm_target * ti )
3807
3824
{
3808
3825
struct raid_set * rs = ti -> private ;
@@ -4087,6 +4104,7 @@ static struct target_type raid_target = {
4087
4104
.message = raid_message ,
4088
4105
.iterate_devices = raid_iterate_devices ,
4089
4106
.io_hints = raid_io_hints ,
4107
+ .presuspend = raid_presuspend ,
4090
4108
.postsuspend = raid_postsuspend ,
4091
4109
.preresume = raid_preresume ,
4092
4110
.resume = raid_resume ,
Original file line number Diff line number Diff line change @@ -659,6 +659,7 @@ struct md_personality
659
659
int (* start_reshape ) (struct mddev * mddev );
660
660
void (* finish_reshape ) (struct mddev * mddev );
661
661
void (* update_reshape_pos ) (struct mddev * mddev );
662
+ void (* prepare_suspend ) (struct mddev * mddev );
662
663
/* quiesce suspends or resumes internal processing.
663
664
* 1 - stop new actions and wait for action io to complete
664
665
* 0 - return to normal behaviour
You can’t perform that action at this time.
0 commit comments