diff options
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index eaa2d3ee2b5d..72e8a324dcfb 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -5167,8 +5167,7 @@ static int raid5_reconfig(mddev_t *mddev, int new_layout, int new_chunk) | |||
5167 | if (new_layout >= 0 && !algorithm_valid_raid5(new_layout)) | 5167 | if (new_layout >= 0 && !algorithm_valid_raid5(new_layout)) |
5168 | return -EINVAL; | 5168 | return -EINVAL; |
5169 | if (new_chunk > 0) { | 5169 | if (new_chunk > 0) { |
5170 | if (new_chunk & (new_chunk-1)) | 5170 | if (!is_power_of_2(new_chunk)) |
5171 | /* not a power of 2 */ | ||
5172 | return -EINVAL; | 5171 | return -EINVAL; |
5173 | if (new_chunk < PAGE_SIZE) | 5172 | if (new_chunk < PAGE_SIZE) |
5174 | return -EINVAL; | 5173 | return -EINVAL; |
@@ -5206,8 +5205,7 @@ static int raid6_reconfig(mddev_t *mddev, int new_layout, int new_chunk) | |||
5206 | if (new_layout >= 0 && !algorithm_valid_raid6(new_layout)) | 5205 | if (new_layout >= 0 && !algorithm_valid_raid6(new_layout)) |
5207 | return -EINVAL; | 5206 | return -EINVAL; |
5208 | if (new_chunk > 0) { | 5207 | if (new_chunk > 0) { |
5209 | if (new_chunk & (new_chunk-1)) | 5208 | if (!is_power_of_2(new_chunk)) |
5210 | /* not a power of 2 */ | ||
5211 | return -EINVAL; | 5209 | return -EINVAL; |
5212 | if (new_chunk < PAGE_SIZE) | 5210 | if (new_chunk < PAGE_SIZE) |
5213 | return -EINVAL; | 5211 | return -EINVAL; |