]> git.baikalelectronics.ru Git - kernel.git/commit
lib/sbitmap: Fix invalid loop in __sbitmap_queue_get_batch()
authorwuchi <wuchi.zero@gmail.com>
Sun, 5 Jun 2022 14:58:35 +0000 (22:58 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 25 Jun 2022 16:58:55 +0000 (10:58 -0600)
commit726f7142eca1a8c8760aeb291eb633821320c719
tree9d4db32a35428644a80a8b96c48b898063f7a98e
parent36574c126a355aab6ca38c9b190257bb90d3133d
lib/sbitmap: Fix invalid loop in __sbitmap_queue_get_batch()

1. Getting next index before continue branch.
2. Checking free bits when setting the target bits. Otherwise,
it may reuse the busying bits.

Signed-off-by: wuchi <wuchi.zero@gmail.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Link: https://lore.kernel.org/r/20220605145835.26916-1-wuchi.zero@gmail.com
Fixes: 1deeb5d73a89 ("sbitmap: add __sbitmap_queue_get_batch()")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/sbitmap.c