summaryrefslogtreecommitdiff
path: root/Create.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2017-05-12 12:32:07 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2017-05-12 12:32:07 +0100
commit77b19ed5f259bc62680acf2b1a3454baa2472bc5 (patch)
tree7441d8d057c09e54c8ea23c984f2ccdf22c98649 /Create.c
parentca114f3c76374493f0fd64f8ea0a9b96ae9b1dc5 (diff)
New upstream release.
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/Create.c b/Create.c
index 1e4a6ee0..2721884e 100644
--- a/Create.c
+++ b/Create.c
@@ -114,8 +114,13 @@ int Create(struct supertype *st, char *mddev,
unsigned long long newsize;
int major_num = BITMAP_MAJOR_HI;
- if (s->bitmap_file && strcmp(s->bitmap_file, "clustered") == 0)
+ if (s->bitmap_file && strcmp(s->bitmap_file, "clustered") == 0) {
major_num = BITMAP_MAJOR_CLUSTERED;
+ if (c->nodes <= 1) {
+ pr_err("At least 2 nodes are needed for cluster-md\n");
+ return 1;
+ }
+ }
memset(&info, 0, sizeof(info));
if (s->level == UnSet && st && st->ss->default_geometry)
@@ -769,9 +774,9 @@ int Create(struct supertype *st, char *mddev,
st->ss->name);
goto abort_locked;
}
- if (!st->ss->add_internal_bitmap(st, &s->bitmap_chunk,
- c->delay, s->write_behind,
- bitmapsize, 1, major_num)) {
+ if (st->ss->add_internal_bitmap(st, &s->bitmap_chunk,
+ c->delay, s->write_behind,
+ bitmapsize, 1, major_num)) {
pr_err("Given bitmap chunk size not supported.\n");
goto abort_locked;
}
@@ -883,8 +888,10 @@ int Create(struct supertype *st, char *mddev,
else
inf->disk.state = 0;
- if (dv->writemostly == 1)
+ if (dv->writemostly == FlagSet)
inf->disk.state |= (1<<MD_DISK_WRITEMOSTLY);
+ if (dv->failfast == FlagSet)
+ inf->disk.state |= (1<<MD_DISK_FAILFAST);
if (have_container)
fd = -1;