Skip to content

Commit

Permalink
dm: add two lockdep_assert_held() statements
Browse files Browse the repository at this point in the history
Document the locking assumptions for the __bind() and __dm_suspend()
functions.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Bart Van Assche authored and Mike Snitzer committed Sep 14, 2016
1 parent c533f24 commit 5a8f1f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,8 @@ static struct dm_table *__bind(struct mapped_device *md, struct dm_table *t,
struct request_queue *q = md->queue;
sector_t size;

lockdep_assert_held(&md->suspend_lock);

size = dm_table_get_size(t);

/*
Expand Down Expand Up @@ -2094,6 +2096,8 @@ static int __dm_suspend(struct mapped_device *md, struct dm_table *map,
bool noflush = suspend_flags & DM_SUSPEND_NOFLUSH_FLAG;
int r;

lockdep_assert_held(&md->suspend_lock);

/*
* DMF_NOFLUSH_SUSPENDING must be set before presuspend.
* This flag is cleared before dm_suspend returns.
Expand Down

0 comments on commit 5a8f1f8

Please sign in to comment.