projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'trace-fixes-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rosted...
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
md
/
dm-stripe.c
diff --git
a/drivers/md/dm-stripe.c
b/drivers/md/dm-stripe.c
index ea5e878a30b93b1f974d449738fc46b55d5eaeba..d907ca6227cec3519e46ac95e146656b342125c2 100644
(file)
--- a/
drivers/md/dm-stripe.c
+++ b/
drivers/md/dm-stripe.c
@@
-94,7
+94,7
@@
static int get_stripe(struct dm_target *ti, struct stripe_c *sc,
static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
{
struct stripe_c *sc;
static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
{
struct stripe_c *sc;
- sector_t width;
+ sector_t width
, tmp_len
;
uint32_t stripes;
uint32_t chunk_size;
int r;
uint32_t stripes;
uint32_t chunk_size;
int r;
@@
-116,15
+116,16
@@
static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}
width = ti->len;
}
width = ti->len;
- if (sector_div(width,
chunk_size
)) {
+ if (sector_div(width,
stripes
)) {
ti->error = "Target length not divisible by "
ti->error = "Target length not divisible by "
- "
chunk size
";
+ "
number of stripes
";
return -EINVAL;
}
return -EINVAL;
}
- if (sector_div(width, stripes)) {
+ tmp_len = width;
+ if (sector_div(tmp_len, chunk_size)) {
ti->error = "Target length not divisible by "
ti->error = "Target length not divisible by "
- "
number of stripes
";
+ "
chunk size
";
return -EINVAL;
}
return -EINVAL;
}