diff options
author | Czarnowska, Anna <anna.czarnowska@intel.com> | 2011-03-30 11:28:11 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-04-05 09:27:40 +1000 |
commit | db975ab5c3d68daef5e739c9263bb6c4e5b178b8 (patch) | |
tree | ded595cbc0f53ba31831a3dc722ae765e4395176 /Create.c | |
parent | 84f3857fec97c9fd459c23e45d8d5abe9dae9da0 (diff) |
Create: check for UnSet when looking at chunk
A default chunk size of 0 gets modified to UnSet, so any location that
checks for !chunk really needs to check for !(chunk || chunk == UnSet).
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Create.c')
-rw-r--r-- | Create.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -266,7 +266,7 @@ int Create(struct supertype *st, char *mddev, &chunk, size*2, NULL, &newsize, verbose>=0)) return 1; - if (chunk) { + if (chunk && chunk != UnSet) { newsize &= ~(unsigned long long)(chunk*2 - 1); size &= ~(unsigned long long)(chunk - 1); } @@ -353,7 +353,7 @@ int Create(struct supertype *st, char *mddev, } freesize /= 2; /* convert to K */ - if (chunk) { + if (chunk && chunk != UnSet) { /* round to chunk size */ freesize = freesize & ~(chunk-1); } |