From b959dcfcd0319d4311e67fa40ebb407605efc9d9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 12 May 2023 14:47:09 +0200 Subject: Merging upstream version 4.2+20230508. Signed-off-by: Daniel Baumann --- Create.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'Create.c') 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(); -- cgit v1.2.3