Skip to content

Commit

Permalink
lightnvm: pblk: add lock assertions on helpers
Browse files Browse the repository at this point in the history
Add lockdep assertions on helper functions.

Signed-off-by: Javier González <[email protected]>
Signed-off-by: Matias Bjørling <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Javier González authored and axboe committed Jun 26, 2017
1 parent 0c0ea88 commit 476118c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/lightnvm/pblk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ struct list_head *pblk_line_gc_list(struct pblk *pblk, struct pblk_line *line)
struct list_head *move_list = NULL;
int vsc = le32_to_cpu(*line->vsc);

lockdep_assert_held(&line->lock);

if (!vsc) {
if (line->gc_group != PBLK_LINEGC_FULL) {
line->gc_group = PBLK_LINEGC_FULL;
Expand Down Expand Up @@ -502,6 +504,8 @@ u64 __pblk_alloc_page(struct pblk *pblk, struct pblk_line *line, int nr_secs)
u64 addr;
int i;

lockdep_assert_held(&line->lock);

/* logic error: ppa out-of-bounds. Prevent generating bad address */
if (line->cur_sec + nr_secs > pblk->lm.sec_per_line) {
WARN(1, "pblk: page allocation out of bounds\n");
Expand Down

0 comments on commit 476118c

Please sign in to comment.