aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2017-04-27 10:11:21 -0700
committerMike Snitzer <snitzer@redhat.com>2017-04-27 17:08:42 -0400
commit1ea0654e46eb62acc379000be2f16350101ebf85 (patch)
tree52dceb575d77441dbbd2a5a2ec9f56f54304a2bc /drivers/md/dm-table.c
parentdm block manager: remove an unused argument from dm_block_manager_create() (diff)
downloadlinux-dev-1ea0654e46eb62acc379000be2f16350101ebf85.tar.xz
linux-dev-1ea0654e46eb62acc379000be2f16350101ebf85.zip
dm: verify suspend_locking assumptions at runtime
Ensure that the assumptions about the caller holding suspend_lock are checked at runtime if lockdep is enabled. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/md/dm-table.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index c68757f94e16..515136f29115 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1680,6 +1680,8 @@ static void suspend_targets(struct dm_table *t, enum suspend_mode mode)
int i = t->num_targets;
struct dm_target *ti = t->targets;
+ lockdep_assert_held(&t->md->suspend_lock);
+
while (i--) {
switch (mode) {
case PRESUSPEND:
@@ -1727,6 +1729,8 @@ int dm_table_resume_targets(struct dm_table *t)
{
int i, r = 0;
+ lockdep_assert_held(&t->md->suspend_lock);
+
for (i = 0; i < t->num_targets; i++) {
struct dm_target *ti = t->targets + i;