]> git.baikalelectronics.ru Git - kernel.git/commit
dm raid: fix round up of default region size
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 2 Oct 2015 15:17:37 +0000 (11:17 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 2 Oct 2015 16:02:31 +0000 (12:02 -0400)
commit23e391960c96c230dc208c309baf48857bbcd732
tree623f271b1b370a493b1c2adc9c0b2734749a934c
parent6401bf008c009e4aa4f69a9a1e90b8c0a964b3f0
dm raid: fix round up of default region size

Commit 1a17e690fcf1 ("dm raid: round region_size to power of two")
intended to make sure that the default region size is a power of two.
However, the logic in that commit is incorrect and sets the variable
region_size to 0 or 1, depending on whether min_region_size is a power
of two.

Fix this logic, using roundup_pow_of_two(), so that region_size is
properly rounded up to the next power of two.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 1a17e690fcf1 ("dm raid: round region_size to power of two")
Cc: stable@vger.kernel.org # v3.8+
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-raid.c