mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
dm space map common: fix division bug in sm_ll_find_free_block()
commit 5208692e80
upstream.
This division bug meant the search for free metadata space could skip
the final allocation bitmap's worth of entries. Fix affects DM thinp,
cache and era targets.
Cc: stable@vger.kernel.org
Signed-off-by: Joe Thornber <ejt@redhat.com>
Tested-by: Ming-Hung Tsai <mtsai@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6fcaa44105
commit
ff8fd1e3b5
1 changed files with 2 additions and 0 deletions
|
@ -339,6 +339,8 @@ int sm_ll_find_free_block(struct ll_disk *ll, dm_block_t begin,
|
|||
*/
|
||||
begin = do_div(index_begin, ll->entries_per_block);
|
||||
end = do_div(end, ll->entries_per_block);
|
||||
if (end == 0)
|
||||
end = ll->entries_per_block;
|
||||
|
||||
for (i = index_begin; i < index_end; i++, begin = 0) {
|
||||
struct dm_block *blk;
|
||||
|
|
Loading…
Reference in a new issue