Skip to content

Commit

Permalink
sbitmap: warn if using smaller shallow depth than was setup
Browse files Browse the repository at this point in the history
Make sure the user passed the right value to
sbitmap_queue_min_shallow_depth().

Acked-by: Paolo Valente <[email protected]>
Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
osandov authored and axboe committed May 10, 2018
1 parent 2882064 commit 61445b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sbitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ int __sbitmap_queue_get_shallow(struct sbitmap_queue *sbq,
unsigned int hint, depth;
int nr;

WARN_ON_ONCE(shallow_depth < sbq->min_shallow_depth);

hint = this_cpu_read(*sbq->alloc_hint);
depth = READ_ONCE(sbq->sb.depth);
if (unlikely(hint >= depth)) {
Expand Down

0 comments on commit 61445b5

Please sign in to comment.