dm-raid1: add cancel_presuspend function
RFC PATCH 2/3 dm-raid1: add cancel_presuspend function
When suspend is interrupted after presuspend procedure, mirror target needs to reset and release following variables:
- reset ms->suspend flag
- release semaphore (rh->recovery_count)
Signed-off-by Takahiro Yasui <[email protected]>
--- drivers/md/dm-raid1.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/md/dm-raid1.c +9 -0
@@ -1311,6 +1311,14 @@ static void mirror_postsuspend(struct dmDMWARN ("log postsuspend failed" ); } +static void mirror_cancel_presuspend (struct dm_target *ti) +{ +struct mirror_set *ms = ti->private; + +atomic_set (&ms->suspend,0 ); +dm_rh_start_recovery (ms->rh); +} +static void mirror_resume (struct dm_target *ti) {struct mirror_set *ms = ti->private;
@@ -1412,6 +1420,7 @@ static struct target_type mirror_target .end_io = mirror_end_io, .presuspend = mirror_presuspend, .postsuspend = mirror_postsuspend, + .cancel_presuspend = mirror_cancel_presuspend, .resume = mirror_resume, .status = mirror_status, .iterate_devices = mirror_iterate_devices,
Signature · 2 lines
Takahiro Yasui Hitachi Computer Products (America), Inc.