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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:37:50 +0000 (14:37 -0700)
commitbad5bfcd07d6bcd73d8e4e141c9c1904b21d7053
tree99b55730f4e7ff0f663f194b139e32f66eaf33bd
parent03fbf7001db5ecf209a9f36faa5a607e39cd54e9
dm raid: fix round up of default region size

commit 042745ee53a0a7c1f5aff191a4a24213c6dcfb52 upstream.

Commit 3a0f9aaee028 ("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: 3a0f9aaee028 ("dm raid: round region_size to power of two")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-raid.c