File 0151-Create-minor-fix-when-adding-a-journal-device.patch of Package mdadm.5365
From dfd7822ca686339f77ea808a4bdf2b085674e611 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Thu, 14 Jan 2016 14:09:57 +1100
Subject: [PATCH 211/359] Create: minor fix when adding a journal device
References: bsc#1081910
The check of "is there a filesystem here" is still appropriate for a
journal device.
Also set active_disks correctly - even though it is ignored.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Coly Li <colyli@suse.de>
---
Create.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Create.c b/Create.c
index 40f1b7e..1e4a6ee 100644
--- a/Create.c
+++ b/Create.c
@@ -330,7 +330,7 @@ int Create(struct supertype *st, char *mddev,
}
close(dfd);
info.array.working_disks++;
- if (dnum < s->raiddisks)
+ if (dnum < s->raiddisks && dv->disposition != 'j')
info.array.active_disks++;
if (st == NULL) {
struct createinfo *ci = conf_get_create_info();
@@ -400,7 +400,7 @@ int Create(struct supertype *st, char *mddev,
}
if (dv->disposition == 'j')
- continue; /* skip write journal for size check */
+ goto skip_size_check; /* skip write journal for size check */
freesize /= 2; /* convert to K */
if (s->chunk && s->chunk != UnSet) {
@@ -434,6 +434,7 @@ int Create(struct supertype *st, char *mddev,
mindisc = dname;
minsize = freesize;
}
+ skip_size_check:
if (c->runstop != 1 || c->verbose >= 0) {
int fd = open(dname, O_RDONLY);
if (fd <0 ) {
--
2.16.1