summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-07-09 09:21:06 +0200
committerNeilBrown <neilb@suse.de>2012-07-09 09:21:06 +0200
commita93f8c6540892d78ae8886d03434eb0a78175187 (patch)
treea4469c4f39cd3c3b78651ad468210685eb5f3a6d /mdadm.c
parentChange the values for "max size" from -1 to 1. (diff)
downloadmdadm-a93f8c6540892d78ae8886d03434eb0a78175187.tar.xz
mdadm-a93f8c6540892d78ae8886d03434eb0a78175187.zip
change array_size to be unsigned and use the new MAX_SIZE
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-rw-r--r--mdadm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mdadm.c b/mdadm.c
index 8832effd..d6f8384f 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
int chunk = 0;
unsigned long long size = 0;
- long long array_size = -1;
+ unsigned long long array_size = 0;
int level = UnSet;
int layout = UnSet;
char *layout_str = NULL;
@@ -436,13 +436,13 @@ int main(int argc, char *argv[])
continue;
case O(GROW,'Z'): /* array size */
- if (array_size >= 0) {
+ if (array_size > 0) {
pr_err("array-size may only be specified once. "
"Second value is %s.\n", optarg);
exit(2);
}
if (strcmp(optarg, "max") == 0)
- array_size = 0;
+ array_size = MAX_SIZE;
else {
array_size = parse_size(optarg);
if (array_size <= 0) {
@@ -1397,7 +1397,7 @@ int main(int argc, char *argv[])
break;
case GROW:
- if (array_size >= 0) {
+ if (array_size > 0) {
/* alway impose array size first, independent of
* anything else
* Do not allow level or raid_disks changes at the
@@ -1413,7 +1413,7 @@ int main(int argc, char *argv[])
break;
}
sysfs_init(&sra, mdfd, 0);
- if (array_size == 0)
+ if (array_size == MAX_SIZE)
err = sysfs_set_str(&sra, NULL, "array_size", "default");
else
err = sysfs_set_num(&sra, NULL, "array_size", array_size / 2);
@@ -1465,7 +1465,7 @@ int main(int argc, char *argv[])
size, level, layout_str, chunk, raiddisks,
devlist->next,
assume_clean, c.force);
- } else if (array_size < 0)
+ } else if (array_size == 0)
pr_err("no changes to --grow\n");
break;
case INCREMENTAL: