From: Dan Williams <djbw@xxxxxx> Stopping at the first ':' precludes using device names like /dev/disk/by-path/pci-0000:04:00.0-sas-0x500605b005846060:1:0-0x5000cca01a7c5605:10 so, check that the name is not ambiguous before chopping off the offset at the end Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx> Signed-off-by: Song Liu <songliubraving@xxxxxx> --- Create.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Create.c b/Create.c index 21d1374..2642b36 100644 --- a/Create.c +++ b/Create.c @@ -306,7 +306,13 @@ int Create(struct supertype *st, char *mddev, continue; } if (data_offset == VARIABLE_OFFSET) { - doff = strchr(dname, ':'); + doff = strrchr(dname, ':'); + if (stat(dname, &stb) == 0) { + pr_err("cannot determine if %s is a device name, or a device with a data-offset argument of '%s'\n", + dname, doff+1); + pr_err("check that you have specified a data-offset for all array members\n"); + exit(2); + } if (doff) { *doff++ = 0; dv->data_offset = parse_size(doff); -- 2.4.6 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html