aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
103 return -EINVAL; 103 return -EINVAL;
104 } 104 }
105 105
106 if (((uint32_t)ti->len) & (chunk_size - 1)) {
107 ti->error = "dm-stripe: Target length not divisible by "
108 "chunk size";
109 return -EINVAL;
110 }
111
106 width = ti->len; 112 width = ti->len;
107 if (sector_div(width, stripes)) { 113 if (sector_div(width, stripes)) {
108 ti->error = "dm-stripe: Target length not divisable by " 114 ti->error = "dm-stripe: Target length not divisible by "
109 "number of stripes"; 115 "number of stripes";
110 return -EINVAL; 116 return -EINVAL;
111 } 117 }