diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-stripe.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c index ab89278a56b..697aacafb02 100644 --- a/drivers/md/dm-stripe.c +++ b/drivers/md/dm-stripe.c @@ -103,9 +103,15 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv) return -EINVAL; } + if (((uint32_t)ti->len) & (chunk_size - 1)) { + ti->error = "dm-stripe: Target length not divisible by " + "chunk size"; + return -EINVAL; + } + width = ti->len; if (sector_div(width, stripes)) { - ti->error = "dm-stripe: Target length not divisable by " + ti->error = "dm-stripe: Target length not divisible by " "number of stripes"; return -EINVAL; } |