aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index b98cd9d84435..2caf5b374649 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -206,6 +206,9 @@ struct mapped_device {
206 /* zero-length flush that will be cloned and submitted to targets */ 206 /* zero-length flush that will be cloned and submitted to targets */
207 struct bio flush_bio; 207 struct bio flush_bio;
208 208
209 /* the number of internal suspends */
210 unsigned internal_suspend_count;
211
209 struct dm_stats stats; 212 struct dm_stats stats;
210}; 213};
211 214
@@ -2928,7 +2931,7 @@ static void __dm_internal_suspend(struct mapped_device *md, unsigned suspend_fla
2928{ 2931{
2929 struct dm_table *map = NULL; 2932 struct dm_table *map = NULL;
2930 2933
2931 if (dm_suspended_internally_md(md)) 2934 if (md->internal_suspend_count++)
2932 return; /* nested internal suspend */ 2935 return; /* nested internal suspend */
2933 2936
2934 if (dm_suspended_md(md)) { 2937 if (dm_suspended_md(md)) {
@@ -2953,7 +2956,9 @@ static void __dm_internal_suspend(struct mapped_device *md, unsigned suspend_fla
2953 2956
2954static void __dm_internal_resume(struct mapped_device *md) 2957static void __dm_internal_resume(struct mapped_device *md)
2955{ 2958{
2956 if (!dm_suspended_internally_md(md)) 2959 BUG_ON(!md->internal_suspend_count);
2960
2961 if (--md->internal_suspend_count)
2957 return; /* resume from nested internal suspend */ 2962 return; /* resume from nested internal suspend */
2958 2963
2959 if (dm_suspended_md(md)) 2964 if (dm_suspended_md(md))