diff options
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 5d40555b42ba..bb3ad79c14d7 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1055,14 +1055,17 @@ int dm_suspend(struct mapped_device *md) | |||
1055 | if (test_bit(DMF_BLOCK_IO, &md->flags)) | 1055 | if (test_bit(DMF_BLOCK_IO, &md->flags)) |
1056 | goto out_read_unlock; | 1056 | goto out_read_unlock; |
1057 | 1057 | ||
1058 | error = __lock_fs(md); | ||
1059 | if (error) | ||
1060 | goto out_read_unlock; | ||
1061 | |||
1062 | map = dm_get_table(md); | 1058 | map = dm_get_table(md); |
1063 | if (map) | 1059 | if (map) |
1060 | /* This does not get reverted if there's an error later. */ | ||
1064 | dm_table_presuspend_targets(map); | 1061 | dm_table_presuspend_targets(map); |
1065 | 1062 | ||
1063 | error = __lock_fs(md); | ||
1064 | if (error) { | ||
1065 | dm_table_put(map); | ||
1066 | goto out_read_unlock; | ||
1067 | } | ||
1068 | |||
1066 | up_read(&md->lock); | 1069 | up_read(&md->lock); |
1067 | 1070 | ||
1068 | /* | 1071 | /* |
@@ -1121,7 +1124,6 @@ int dm_suspend(struct mapped_device *md) | |||
1121 | return 0; | 1124 | return 0; |
1122 | 1125 | ||
1123 | out_unfreeze: | 1126 | out_unfreeze: |
1124 | /* FIXME Undo dm_table_presuspend_targets */ | ||
1125 | __unlock_fs(md); | 1127 | __unlock_fs(md); |
1126 | clear_bit(DMF_BLOCK_IO, &md->flags); | 1128 | clear_bit(DMF_BLOCK_IO, &md->flags); |
1127 | out_write_unlock: | 1129 | out_write_unlock: |