X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mdadm.c;h=f32a3d4713d206bd29f0278c7df310b370c2044b;hb=cc1799c3ddc99454903a8591bb27f30505bcd2dc;hp=183f6c8067cec52276041dab01296144b652fae2;hpb=ed94976d84768b2ef648c3af1d81f1a36de9f9e2;p=thirdparty%2Fmdadm.git diff --git a/mdadm.c b/mdadm.c index 183f6c80..f32a3d47 100644 --- a/mdadm.c +++ b/mdadm.c @@ -74,6 +74,7 @@ int main(int argc, char *argv[]) .require_homehost = 1, }; struct shape s = { + .journaldisks = 0, .level = UnSet, .layout = UnSet, .bitmap_chunk = UnSet, @@ -1170,6 +1171,23 @@ int main(int argc, char *argv[]) case O(INCREMENTAL, IncrementalPath): remove_path = optarg; continue; + case O(CREATE, WriteJournal): + if (s.journaldisks) { + pr_err("Please specify only one journal device for the array.\n"); + pr_err("Ignoring --write-journal %s...\n", optarg); + continue; + } + dv = xmalloc(sizeof(*dv)); + dv->devname = optarg; + dv->disposition = 'j'; /* WriteJournal */ + dv->used = 0; + dv->next = NULL; + *devlistend = dv; + devlistend = &dv->next; + devs_found++; + + s.journaldisks = 1; + continue; } /* We have now processed all the valid options. Anything else is * an error @@ -1197,6 +1215,11 @@ int main(int argc, char *argv[]) exit(0); } + if (s.journaldisks && (s.level < 4 || s.level > 6)) { + pr_err("--write-journal is only supported for RAID level 4/5/6.\n"); + exit(2); + } + if (!mode && devs_found) { mode = MISC; devmode = 'Q';