summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-stripe.c
diff options
context:
space:
mode:
authorJeff Garzik2006-03-20 10:38:03 +0100
committerJeff Garzik2006-03-20 10:38:03 +0100
commitd378aca6ec708bfb24df5c47801b1f2399efc481 (patch)
tree7535f96bf34314df071698d2e06054b8d5223ebb /drivers/md/dm-stripe.c
parentMerge branch 'upstream-fixes' (diff)
parentLinux 2.6.16 (diff)
downloadkernel-qcow2-linux-d378aca6ec708bfb24df5c47801b1f2399efc481.tar.gz
kernel-qcow2-linux-d378aca6ec708bfb24df5c47801b1f2399efc481.tar.xz
kernel-qcow2-linux-d378aca6ec708bfb24df5c47801b1f2399efc481.zip
Merge branch 'master'
Diffstat (limited to 'drivers/md/dm-stripe.c')
-rw-r--r--drivers/md/dm-stripe.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index ab89278a56bf..697aacafb02a 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;
}