* Subject: [ mdadm PATCH 6/6] : mdadm to support 1K chunks
@ 2009-05-18 23:09 raz ben yehuda
0 siblings, 0 replies; only message in thread
From: raz ben yehuda @ 2009-05-18 23:09 UTC (permalink / raw)
To: linux raid, Neil Brown; +Cc: yaronp
fix mdadm to path 1K*n chunks only in the case of raid0.
Commit is stacked on top mdadm.c
commit c8b4de0cccfba18818416f62687e4094a5b83922
Author: NeilBrown <neilb@suse.de>
Date: Tue May 12 15:25:55 2009 +1000
mdadm.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
Signed-off-by: raziebe@gmail.com
---
diff --git a/mdadm.c b/mdadm.c
index 166ea9d..b54e650 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -326,10 +326,25 @@ int main(int argc, char *argv[])
exit(2);
}
chunk = strtol(optarg, &c, 10);
- if (!optarg[0] || *c || chunk<4 || ((chunk-1)&chunk)) {
- fprintf(stderr, Name ": invalid chunk/rounding value: %s\n",
- optarg);
- exit(2);
+ /* if level is parsed, chunk is probably ok */
+ if (level == 0) {
+ if ((chunk <= 0 || !optarg[0] || *c)) {
+ fprintf(stderr,
+ Name ": invalid chunk/rounding"
+ " value: %s %d\n",
+ optarg, chunk);
+ exit(2);
+ }
+ continue;
+ }
+ if (level != UnSet)
+ if (!optarg[0] || *c || chunk < 4 ||
+ ((chunk-1)&chunk)) {
+ fprintf(stderr, Name
+ ": invalid chunk"
+ "/rounding value: %s\n",
+ optarg);
+ exit(2);
}
continue;
@@ -411,6 +426,12 @@ int main(int argc, char *argv[])
optarg);
exit(2);
}
+ if (level != 0 && (chunk % 4)) {
+ fprintf(stderr, Name ": raid level %s must"
+ " have power 2 chunk size\n",
+ optarg);
+ exit(2);
+ }
ident.level = level;
continue;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-18 23:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-18 23:09 Subject: [ mdadm PATCH 6/6] : mdadm to support 1K chunks raz ben yehuda
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.