diff options
Diffstat (limited to 'drivers/md/dm-raid.c')
| -rw-r--r-- | drivers/md/dm-raid.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 6319d846e0ad..398314b6c31a 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c | |||
| @@ -3613,24 +3613,19 @@ static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits) | |||
| 3613 | blk_limits_io_opt(limits, chunk_size * mddev_data_stripes(rs)); | 3613 | blk_limits_io_opt(limits, chunk_size * mddev_data_stripes(rs)); |
| 3614 | } | 3614 | } |
| 3615 | 3615 | ||
| 3616 | static void raid_presuspend(struct dm_target *ti) | ||
| 3617 | { | ||
| 3618 | struct raid_set *rs = ti->private; | ||
| 3619 | |||
| 3620 | md_stop_writes(&rs->md); | ||
| 3621 | } | ||
| 3622 | |||
| 3623 | static void raid_postsuspend(struct dm_target *ti) | 3616 | static void raid_postsuspend(struct dm_target *ti) |
| 3624 | { | 3617 | { |
| 3625 | struct raid_set *rs = ti->private; | 3618 | struct raid_set *rs = ti->private; |
| 3626 | 3619 | ||
| 3627 | if (!test_and_set_bit(RT_FLAG_RS_SUSPENDED, &rs->runtime_flags)) { | 3620 | if (!test_and_set_bit(RT_FLAG_RS_SUSPENDED, &rs->runtime_flags)) { |
| 3621 | /* Writes have to be stopped before suspending to avoid deadlocks. */ | ||
| 3622 | if (!test_bit(MD_RECOVERY_FROZEN, &rs->md.recovery)) | ||
| 3623 | md_stop_writes(&rs->md); | ||
| 3624 | |||
| 3628 | mddev_lock_nointr(&rs->md); | 3625 | mddev_lock_nointr(&rs->md); |
| 3629 | mddev_suspend(&rs->md); | 3626 | mddev_suspend(&rs->md); |
| 3630 | mddev_unlock(&rs->md); | 3627 | mddev_unlock(&rs->md); |
| 3631 | } | 3628 | } |
| 3632 | |||
| 3633 | rs->md.ro = 1; | ||
| 3634 | } | 3629 | } |
| 3635 | 3630 | ||
| 3636 | static void attempt_restore_of_faulty_devices(struct raid_set *rs) | 3631 | static void attempt_restore_of_faulty_devices(struct raid_set *rs) |
| @@ -3903,7 +3898,6 @@ static struct target_type raid_target = { | |||
| 3903 | .message = raid_message, | 3898 | .message = raid_message, |
| 3904 | .iterate_devices = raid_iterate_devices, | 3899 | .iterate_devices = raid_iterate_devices, |
| 3905 | .io_hints = raid_io_hints, | 3900 | .io_hints = raid_io_hints, |
| 3906 | .presuspend = raid_presuspend, | ||
| 3907 | .postsuspend = raid_postsuspend, | 3901 | .postsuspend = raid_postsuspend, |
| 3908 | .preresume = raid_preresume, | 3902 | .preresume = raid_preresume, |
| 3909 | .resume = raid_resume, | 3903 | .resume = raid_resume, |
