diff options
author | Mike Snitzer <snitzer@redhat.com> | 2014-10-28 20:13:31 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-11-19 11:24:59 -0500 |
commit | d67ee213fa5700c7da526fe5bcccd485cfa63d8b (patch) | |
tree | 9ba735535bac6b904191702006275ec8115d9803 /drivers/md/dm.c | |
parent | 4d341d8216336174d35cd2575b6b9e4267a88ac8 (diff) |
dm: add presuspend_undo hook to target_type
The DM thin-pool target now must undo the changes performed during
pool_presuspend() so introduce presuspend_undo hook in target_type.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Joe Thornber <ejt@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f8cdd97c28a7..f84de3215982 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -2756,7 +2756,10 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags) | |||
2756 | if (noflush) | 2756 | if (noflush) |
2757 | set_bit(DMF_NOFLUSH_SUSPENDING, &md->flags); | 2757 | set_bit(DMF_NOFLUSH_SUSPENDING, &md->flags); |
2758 | 2758 | ||
2759 | /* This does not get reverted if there's an error later. */ | 2759 | /* |
2760 | * This gets reverted if there's an error later and the targets | ||
2761 | * provide the .presuspend_undo hook. | ||
2762 | */ | ||
2760 | dm_table_presuspend_targets(map); | 2763 | dm_table_presuspend_targets(map); |
2761 | 2764 | ||
2762 | /* | 2765 | /* |
@@ -2767,8 +2770,10 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags) | |||
2767 | */ | 2770 | */ |
2768 | if (!noflush && do_lockfs) { | 2771 | if (!noflush && do_lockfs) { |
2769 | r = lock_fs(md); | 2772 | r = lock_fs(md); |
2770 | if (r) | 2773 | if (r) { |
2774 | dm_table_presuspend_undo_targets(map); | ||
2771 | goto out_unlock; | 2775 | goto out_unlock; |
2776 | } | ||
2772 | } | 2777 | } |
2773 | 2778 | ||
2774 | /* | 2779 | /* |
@@ -2816,6 +2821,7 @@ int dm_suspend(struct mapped_device *md, unsigned suspend_flags) | |||
2816 | start_queue(md->queue); | 2821 | start_queue(md->queue); |
2817 | 2822 | ||
2818 | unlock_fs(md); | 2823 | unlock_fs(md); |
2824 | dm_table_presuspend_undo_targets(map); | ||
2819 | goto out_unlock; /* pushback list is already flushed, so skip flush */ | 2825 | goto out_unlock; /* pushback list is already flushed, so skip flush */ |
2820 | } | 2826 | } |
2821 | 2827 | ||