summaryrefslogtreecommitdiffstats
path: root/Create.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-12 12:47:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-12 12:47:09 +0000
commitb959dcfcd0319d4311e67fa40ebb407605efc9d9 (patch)
treeac91bd6261967ff19b62a1859a4f544112ec4522 /Create.c
parentReleasing debian version 4.2+20230313-1. (diff)
downloadmdadm-b959dcfcd0319d4311e67fa40ebb407605efc9d9.tar.xz
mdadm-b959dcfcd0319d4311e67fa40ebb407605efc9d9.zip
Merging upstream version 4.2+20230508.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'Create.c')
-rw-r--r--Create.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/Create.c b/Create.c
index bbe9e13..ea6a474 100644
--- a/Create.c
+++ b/Create.c
@@ -328,7 +328,7 @@ static int update_metadata(int mdfd, struct shape *s, struct supertype *st,
* again returns container info.
*/
st->ss->getinfo_super(st, &info_new, NULL);
- if (st->ss->external && is_container(s->level) &&
+ if (st->ss->external && !is_container(s->level) &&
!same_uuid(info_new.uuid, info->uuid, 0)) {
map_update(map, fd2devnm(mdfd),
info_new.text_version,
@@ -636,11 +636,6 @@ int Create(struct supertype *st, char *mddev,
break;
case LEVEL_LINEAR:
/* a chunksize of zero 0s perfectly valid (and preferred) since 2.6.16 */
- if (get_linux_version() < 2006016 && s->chunk == 0) {
- s->chunk = 64;
- if (c->verbose > 0)
- pr_err("chunk size defaults to 64K\n");
- }
break;
case 1:
case LEVEL_FAULTY:
@@ -1029,10 +1024,9 @@ int Create(struct supertype *st, char *mddev,
* it could be in conflict with already existing device
* e.g. container, array
*/
- if (strncmp(chosen_name, "/dev/md/", 8) == 0 &&
- map_by_name(&map, chosen_name+8) != NULL) {
- pr_err("Array name %s is in use already.\n",
- chosen_name);
+ if (strncmp(chosen_name, DEV_MD_DIR, DEV_MD_DIR_LEN) == 0 &&
+ map_by_name(&map, chosen_name + DEV_MD_DIR_LEN)) {
+ pr_err("Array name %s is in use already.\n", chosen_name);
close(mdfd);
map_unlock(&map);
udev_unblock();