diff options
author | NeilBrown <neilb@suse.de> | 2009-10-01 16:58:40 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-10-01 16:58:40 +1000 |
commit | ca4f89a3b76187dcd7ca897035a8e92ab67b252d (patch) | |
tree | cfb7a91f30f6f3b51662257c47b581089705acb1 /Create.c | |
parent | e38cc2d87b319572fe7ff08be5657f563b1ef9e7 (diff) | |
parent | 2b9aa337af7291d3f141322da96c9f667c99d53c (diff) | |
download | mdadm-ca4f89a3b76187dcd7ca897035a8e92ab67b252d.tar.gz mdadm-ca4f89a3b76187dcd7ca897035a8e92ab67b252d.tar.xz mdadm-ca4f89a3b76187dcd7ca897035a8e92ab67b252d.zip |
Merge branch 'master' into devel-3.1
Conflicts:
mdadm.8
Diffstat (limited to 'Create.c')
-rw-r--r-- | Create.c | 41 |
1 files changed, 34 insertions, 7 deletions
@@ -1,7 +1,7 @@ /* * mdadm - manage Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de> + * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de> * * * This program is free software; you can redistribute it and/or modify @@ -19,12 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Neil Brown - * Email: <neilb@cse.unsw.edu.au> - * Paper: Neil Brown - * School of Computer Science and Engineering - * The University of New South Wales - * Sydney, 2052 - * Australia + * Email: <neilb@suse.de> */ #include "mdadm.h" @@ -797,7 +792,39 @@ int Create(struct supertype *st, char *mddev, dv == moved_disk && dnum != insert_point) break; } if (pass == 1) { + struct mdinfo info_new; + struct map_ent *me = NULL; + + /* check to see if the uuid has changed due to these + * metadata changes, and if so update the member array + * and container uuid. Note ->write_init_super clears + * the subarray cursor such that ->getinfo_super once + * again returns container info. + */ + map_lock(&map); + st->ss->getinfo_super(st, &info_new); + if (st->ss->external && level != LEVEL_CONTAINER && + !same_uuid(info_new.uuid, info.uuid, 0)) { + map_update(&map, fd2devnum(mdfd), + info_new.text_version, + info_new.uuid, chosen_name); + me = map_by_devnum(&map, st->container_dev); + } + st->ss->write_init_super(st); + + /* update parent container uuid */ + if (me) { + char *path = strdup(me->path); + + st->ss->getinfo_super(st, &info_new); + map_update(&map, st->container_dev, + info_new.text_version, + info_new.uuid, path); + free(path); + } + map_unlock(&map); + flush_metadata_updates(st); } } |