diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2017-04-27 19:11:21 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2017-04-27 23:08:42 +0200 |
commit | 1ea0654e46eb62acc379000be2f16350101ebf85 (patch) | |
tree | 52dceb575d77441dbbd2a5a2ec9f56f54304a2bc /drivers/md/dm-table.c | |
parent | dm block manager: remove an unused argument from dm_block_manager_create() (diff) | |
download | linux-1ea0654e46eb62acc379000be2f16350101ebf85.tar.xz linux-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 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 4 |
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; |