Skip to contentSkip to conversation

pending fixes for mdadm 3.0.1

GIT PULL Dan Williams 2 participants 3 messages Aug 4, 2009 – Aug 15, 2009 MD RAID

lore
Share & tools
lore
#0 lore raw

The following changes since commit fa09d4961e5c72da3c7f78d53a7d64f5196110a3:
NeilBrown (1):
Examine: fix --examine --brief --verbose on containers.

are available in the git repository at:

git://github.com/djbw/mdadm.git master

Dan Williams (10):
teach imsm and ddf what st->subarray means at load_super time fix RebuildMap() to retrieve 'subarray' info
fix examine_brief segfault
imsm: fixup examine_brief to be more descriptive in the container only case conditionally update uuids in the map file after Create()
imsm: fix activate_spare off-by-one
imsm: fix family number handling
platform: relax rom scanning alignment for ahci platforms
imsm: fix spare-uuid assignment
Assemble: fix handling of empty container

 Assemble.c       |    2 +
 Create.c         |   32 ++++++++++++++++
 Examine.c        |    4 +--
 mapfile.c        |   32 ++++++++++++++++-
 mdadm.h          |    1 +
 platform-intel.c |    7 +++-
 probe_roms.c     |   26 +++++++++++---
 probe_roms.h     |    2 +-
 super-ddf.c      |   42 +++++++++++++--------
 super-intel.c    |  104 ++++++++++++++++++++++++++++++++++++++++--------------
 util.c           |   11 ++++++
 11 files changed, 209 insertions(+), 54 deletions(-)

Hi Neil,

This is the same queue that was sent previously [1], but with a few additions:

1/ Fix family number handling - it turns out that the family_number field can change. This approximates homehost functionality in that a former member array that is rebuilt on another system will have its family number changed such that if it is returned it will no longer be considered a member of the original container. Currently this means either the original array or the foreign array can be assembled, but not both. To resolve this conflict my current thinking is that "update homehost" functionality will need to be hijacked to update the orig_family_num field (i.e. the container identifier).

2/ Relax option-rom scanning alignment - any system modern enough to have Intel(R) Matrix RAID will not have legacy ISA regions. This allows us to detect the option-ROM on PCI-3.0-firmware compliant platforms that allow the option-ROM to be located on 512-byte boundary (as opposed to 2048)

3/ A couple segfault fixups.

Lastly, I notice that there is a regression of sorts since commit fa09d496 "Examine: fix --examine --brief --verbose on containers". Changing the order of containers and members confuses mdadm -Asc, or -As when /etc/mdadm.conf is present. We now only get the container, and no members in the multiple container case. Unintended consequence?

Thanks,
Dan

[1] http://article.gmane.org/gmane.linux.raid/23434

commit af99d9ca67a4dc898e7be1d4a947800deec93c83

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:08:22 2009 -0700
    teach imsm and ddf what st->subarray means at load_super time
    
    RebuildMap wants to poll through mdstat and retrieve a (kernel name,
    uuid, user name) tuple for each array.  Teach imsm and ddf to honor
    st->sub_array at ->load_super() time to set their internal subarray
    pointers to the value specified in st->subarray, or return an error if
    st->subarray specifies an invalid array.
    
    Signed-off-by: Dan Williams <[email protected]>

commit f98d41ddb4ac543176f33454ceb70983109272d9

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:11:41 2009 -0700
    fix RebuildMap() to retrieve 'subarray' info
    
    RebuildMap falsely returns container info for member arrays.  Retrieving
    the subarray and container_dev details prior to ->load_super() changes the
    result from:
    
    md127 imsm 082c6371:74b5ce03:64972e41:6b0860d5 /dev/md/imsm
    md126 imsm 082c6371:74b5ce03:64972e41:6b0860d5 /dev/md/vol0
    
    ...to:
    
    md126 /md127/0 3e03aee2:78c3c593:1e8ecaf0:eefb53ed /dev/md/vol0
    md127 imsm 082c6371:74b5ce03:64972e41:6b0860d5 /dev/md/imsm
    
    Reported-by: Ignacy Kasperowicz <[email protected]>
    Signed-off-by: Dan Williams <[email protected]>

commit 37424f132cb3874fe51021b1b5e04445a3ba1bdb

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:11:41 2009 -0700

fix examine_brief segfault

When performing an "-Ebs -e <metadata type>" we segfault because the superblock has been freed too early. We also leak memory for 'ddf' and 'imsm' because, unlike super[01], we do not implicitly free when ->load_super is called on an already loaded supertype.

So, fix up imsm and ddf to match type 0 and 1 ->load_super() semantics, and update Examine to not free the superblock until all usages have been exhausted.

commit 0d5a423fe7481de5ce20c6174841afeb1aadd255

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:11:41 2009 -0700

imsm: fixup examine_brief to be more descriptive in the container only case

Prior to creating any arrays in a new container the output from -Ebs for a 4-disk imsm array returns:

spares=4

We should at least display that these are imsm spares:

ARRAY metadata=imsm
spares=4

commit 9b1fb67776d63a491df3e7aa13916cd122436e20

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:11:41 2009 -0700

conditionally update uuids in the map file after Create()

The map file needs to be updated after adding the first member array to an Intel metadata container. The uuid for an imsm container uses the ->family_num field of the metadata. This field is static, but is only set after the first member array has been created. Prior to this all devices are free floating spares and do not have any information that can identify specific container membership. At Create() time we take the uninitialized uuid from ->get_info_super() prior to updating the metadata. So the current result is:

# mdadm --create /dev/md/imsm /dev/sd[b-e] -n 4 -e imsm # mdadm --create /dev/md/vol0 /dev/md/imsm -n 4 -l 0 # cat /var/run/mdadm/map
md126 /md127/0 3e03aee2:78c3c593:1e8ecaf0:eefb53ed /dev/md/vol0 md127 imsm 53d6f8b1:7a783f24:f30483c5:705c48c7 /dev/md/imsm # mdadm -Ebs
ARRAY metadata=imsm UUID=589d2d2c:4221a54d:acb63c06:c3907f52 ARRAY /dev/md/vol0 container=589d2d2c:4221a54d:acb63c06:c3907f52
member=0 UUID=57b89b63:5cd0eae1:17dd26b3:51cc78d4

So, before we write out the new metadata check to see if the member array uuid has changed as a result of this addition. If it has, update its uuid in the map file and flag its parent container for updating. In support of updating the container uuid the semantics of ->write_init_super are changed to clear any metadata specific member array cursors (e.g. ddf_super.currentconf or intel_super.current_vol) such that a subsequent call to ->getinfo_super returns container information.

commit 329c82786932b2fbc56cd57ac0bfc185d83a04c9

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:11:41 2009 -0700

imsm: fix activate_spare off-by-one

The last sector of an array is calculated by start + size - 1.

commit 148acb7baaa810b68d55df4c1784d6bd0dfd1b78

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:11:41 2009 -0700

imsm: fix family number handling

The family_number field can change. The option-rom will change the family number when it starts a rebuild process (flags a container for rebuild). This was not seen previously as mdadm would usually start the rebuild process, preserving the family number.

This is the mechanism that helps to prevent a prodigal array member from being returned to its original system and cause a rebuild to go in the wrong direction. With the change we will end up with a container that will fail to assemble unless the device with the incompatible family number is left out of the assembly.

So, take several actions:
1/ Convert uuid generation to use orig_family_num, being careful to
preserve the existing uuid in the case where orig_family_num is not set (i.e. previous mdadm created imsm arrays)
2/ Set orig_family_num at Create. For arrays created by mdadm prior to
this release orig_family_num will be zero, so set it to family_num at the first metadata write.
3/ Add checks for orig_family_num to compare_super_imsm
4/ Update the family number when initiating rebuild
5/ The option-rom mixes some random data into the family number, add
this functionality to the mdadm implementation.

commit 969c255511a4bd12e6becc11b2a822f24c1fbb76

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:11:41 2009 -0700

platform: relax rom scanning alignment for ahci platforms

The PCI-3.0 Firmware specification allows for option-roms to have 512-byte alignment rather than 2048-byte. As there does not appear to be a reliable method to detect a PCI-3.0 compliant BIOS from userspace we allow the imsm platform detection code to presume that a system modern enough to have an Intel AHCI controller does not have dangerous/legacy ISA regions in the option-ROM memory space.

An environment variable to disable this behaviour, IMSM_SAFE_OROM_SCAN, is added in case this presumption is ever proven wrong.

commit 7e8545e954dbe0c08277bb8141057c4ae05fada3

Author: Dan Williams <[email protected]>
Date:   Fri Jul 31 17:11:42 2009 -0700

imsm: fix spare-uuid assignment

imsm spares do not have container membership by default so we associate them with the first container found in the configuration file. Some ARRAY lines do not specify the metadata type so we cannot assume that _cst will always be valid.

commit 3ef383aa9616e183cb1eda38fdbe4d7a2ebdfd4c

Author: Dan Williams <[email protected]>
Date:   Tue Aug 4 10:17:23 2009 -0700

Assemble: fix handling of empty container

# mdadm --create /dev/md/ddf /dev/sd[b-e] -n 4 -e ddf
mdadm: container /dev/md/ddf prepared.
# mdadm -Ss
mdadm: stopped /dev/md126
# mdadm -As
mdadm: Container /dev/md/ddf0 has been assembled with 4 drives Segmentation fault

Assemble.c +2 -0
index 3c3a004..4578906 100644
@@ -320,6 +320,8 @@ int Assemble(struct supertype *st, char *mddev,
 				content = tmpdev->content;
 			else
 				content = tst->ss->container_content(tst);
+			if (!content)
+				goto loop; /* empty container */
 
 			tmpdev->content = content->next;
 			if (tmpdev->content == NULL)
Create.c +32 -0
index 8a73799..c96b319 100644
@@ -792,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);
 		}
 	}
Examine.c +1 -3
index f0e98f9..3d0ea8a 100644
@@ -114,10 +114,8 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
 				ap->st = st;
 				arrays = ap;
 				st->ss->getinfo_super(st, &ap->info);
-			} else {
+			} else
 				st->ss->getinfo_super(st, &ap->info);
-				st->ss->free_super(st);
-			}
 			if (!(ap->info.disk.state & (1<<MD_DISK_SYNC)))
 				ap->spares++;
 			d = dl_strdup(devlist->devname);
mapfile.c +31 -1
index 601c4cc..a3038be 100644
@@ -297,6 +297,34 @@ struct map_ent *map_by_name(struct map_ent **map, char *name)
 	return NULL;
 }
 
+/* sets the proper subarray and container_dev according to the metadata
+ * version super_by_fd does this automatically, this routine is meant as
+ * a supplement for guess_super()
+ */
+static void set_member_info(struct supertype *st, struct mdstat_ent *ent)
+{
+	char version[strlen(ent->metadata_version)+1];
+
+	st->subarray[0] = '\0';
+
+	if (strncmp(ent->metadata_version, "external:", 9) != 0)
+		return;
+
+	strcpy(version, ent->metadata_version);
+
+	if (is_subarray(&version[9])) {
+		char *subarray = strrchr(version, '/');
+		char *name = &version[10];
+
+		if (!subarray)
+			return;
+		*subarray++ = '\0';
+
+		st->container_dev = devname2devnum(name);
+		strncpy(st->subarray, subarray, sizeof(st->subarray));
+	}
+}
+
 void RebuildMap(void)
 {
 	struct mdstat_ent *mdstat = mdstat_read(0, 0);
@@ -337,8 +365,10 @@ void RebuildMap(void)
 			st = guess_super(dfd);
 			if ( st == NULL)
 				ok = -1;
-			else
+			else {
+				set_member_info(st, md);
 				ok = st->ss->load_super(st, dfd, NULL);
+			}
 			close(dfd);
 			if (ok != 0)
 				continue;
mdadm.h +1 -0
index e564dee..4111eaf 100644
@@ -848,6 +848,7 @@ extern int open_container(int fd);
 extern int mdmon_running(int devnum);
 extern int signal_mdmon(int devnum);
 extern int check_env(char *name);
+extern __u32 random32(void);
 extern int start_mdmon(int devnum);
 
 extern char *devnum2devname(int num);
platform-intel.c +6 -1
index 5160227..eaf4c48 100644
@@ -157,6 +157,7 @@ static int scan(const void *start, const void *end)
 const struct imsm_orom *find_imsm_orom(void)
 {
 	static int populated = 0;
+	unsigned long align;
 
 	/* it's static data so we only need to read it once */
 	if (populated)
@@ -184,7 +185,11 @@ const struct imsm_orom *find_imsm_orom(void)
 		return NULL;
 
 	/* scan option-rom memory looking for an imsm signature */
-	if (probe_roms_init() != 0)
+	if (check_env("IMSM_SAFE_OROM_SCAN"))
+		align = 2048;
+	else
+		align = 512;
+	if (probe_roms_init(align) != 0)
 		return NULL;
 	probe_roms();
 	populated = scan_adapter_roms(scan);
probe_roms.c +21 -5
index 06ec3f5..a9a8638 100644
@@ -32,6 +32,8 @@ static void *rom_mem = MAP_FAILED;
 static int rom_fd = -1;
 const static int rom_len = 0xf0000 - 0xc0000; /* option-rom memory region */
 static int _sigbus;
+static unsigned long rom_align;
+
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
 static void sigbus(int sig)
@@ -76,11 +78,20 @@ void probe_roms_exit(void)
 	}
 }
 
-int probe_roms_init(void)
+int probe_roms_init(unsigned long align)
 {
 	int fd;
 	int rc = 0;
 
+	/* valid values are 2048 and 512.  512 is for PCI-3.0 compliant
+	 * systems, or systems that do not have dangerous/legacy ISA
+	 * devices.  2048 should always be safe
+	 */
+	if (align == 512 || align == 2048)
+		rom_align = align;
+	else
+		return -1;
+
 	if (signal(SIGBUS, sigbus) == SIG_ERR)
 		rc = -1;
 	if (rc == 0) {
@@ -208,6 +219,11 @@ int scan_adapter_roms(scan_fn fn)
 	return found;
 }
 
+static unsigned long align(unsigned long addr, unsigned long alignment)
+{
+	return (addr + alignment - 1) & ~(alignment - 1);
+}
+
 void probe_roms(void)
 {
 	const void *rom;
@@ -220,7 +236,7 @@ void probe_roms(void)
 
 	/* video rom */
 	upper = adapter_rom_resources[0].start;
-	for (start = video_rom_resource.start; start < upper; start += 2048) {
+	for (start = video_rom_resource.start; start < upper; start += rom_align) {
 		rom = isa_bus_to_virt(start);
 		if (!romsignature(rom))
 			continue;
@@ -239,7 +255,7 @@ void probe_roms(void)
 		break;
 	}
 
-	start = (video_rom_resource.end + 1 + 2047) & ~2047UL;
+	start = align(video_rom_resource.end + 1, rom_align);
 	if (start < upper)
 		start = upper;
 
@@ -255,7 +271,7 @@ void probe_roms(void)
 	}
 
 	/* check for adapter roms on 2k boundaries */
-	for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += 2048) {
+	for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += rom_align) {
 		rom = isa_bus_to_virt(start);
 		if (!romsignature(rom))
 			continue;
@@ -273,7 +289,7 @@ void probe_roms(void)
 		adapter_rom_resources[i].start = start;
 		adapter_rom_resources[i].end = start + length - 1;
 
-		start = adapter_rom_resources[i++].end & ~2047UL;
+		start = adapter_rom_resources[i++].end & ~(rom_align - 1);
 	}
 }
 
probe_roms.h +1 -1
index 557e933..a1e291a 100644
@@ -18,7 +18,7 @@
  */
 
 void probe_roms_exit(void);
-int probe_roms_init(void);
+int probe_roms_init(unsigned long align);
 typedef int (*scan_fn)(const void *start, const void *end);
 int scan_adapter_roms(scan_fn fn);
 void probe_roms(void);
super-ddf.c +26 -16

90 lines not on this page · raw message

super-intel.c +77 -27

282 lines not on this page · raw message

util.c +11 -0
index 00bf803..2543971 100644
@@ -1298,6 +1298,17 @@ int check_env(char *name)
 	return 0;
 }
 
+__u32 random32(void)
+{
+	__u32 rv;
+	int rfd = open("/dev/urandom", O_RDONLY);
+	if (rfd < 0 || read(rfd, &rv, 4) != 4)
+		rv = random();
+	if (rfd >= 0)
+		close(rfd);
+	return rv;
+}
+
 #ifndef MDASSEMBLE
 int flush_metadata_updates(struct supertype *st)
 {
#1 lore raw
Quoted 11 lines · On Tuesday August 4, [email protected] wrote:

The following changes since commit fa09d4961e5c72da3c7f78d53a7d64f5196110a3:
NeilBrown (1):
Examine: fix --examine --brief --verbose on containers.

are available in the git repository at:

git://github.com/djbw/mdadm.git master

Dan Williams (10):
teach imsm and ddf what st->subarray means at load_super time fix RebuildMap() to retrieve 'subarray' info

Thanks. I've pulled and pushed them all, but I'm not quite sure of this one.
What metadata information do we want to have in the map file? The main use of the map file is for incremental assembly. When we find a device, the map file tells us which array/container to attach the device to.
So subarrays probably aren't important in the map file and maybe shouldn't be stored there at all???

What was the context where the current behaviour became an issue?

Quoted 5 lines

Hi Neil,

This is the same queue that was sent previously [1], but with a few additions:

Sorry I didn't respond to that - late June was a bad time for me :-(

Quoted 7 lines

Lastly, I notice that there is a regression of sorts since commit fa09d496 "Examine: fix --examine --brief --verbose on containers". Changing the order of containers and members confuses mdadm -Asc, or -As when /etc/mdadm.conf is present. We now only get the container, and no members in the multiple container case. Unintended consequence?

Certainly unintended. I guess I had forgotten that the order of things in mdadm.conf is important.
Maybe the best approach would be for Examine.c to call in to the metadata handler a second time to get the subarrays.

What would you think of something like the following?

Thanks,
NeilBrown

Examine.c +2 -0
index 02d5ac4..c79a701 100644
@@ -145,6 +145,8 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
 					sep=',';
 				}
 			}
+			if (ap->st->ss->brief_examine_subarrays)
+				ap->st->ss->brief_examine_subarrays(ap->st, brief > 1);
 			ap->st->ss->free_super(ap->st);
 			/* FIXME free ap */
 			if (ap->spares || brief > 1)
mdadm.h +1 -0
index 4111eaf..91ba624 100644
@@ -436,6 +436,7 @@ extern struct superswitch {
 	 */
 	void (*examine_super)(struct supertype *st, char *homehost);
 	void (*brief_examine_super)(struct supertype *st, int verbose);
+	void (*brief_examine_subarrays)(struct supertype *st, int verbose);
 	void (*export_examine_super)(struct supertype *st);
 
 	/* Used to report details of an active array.
super-ddf.c +13 -1
index c28d804..9bf08c2 100644
@@ -1183,6 +1183,18 @@ static void brief_examine_super_ddf(struct supertype *st, int verbose)
 {
 	/* We just write a generic DDF ARRAY entry
 	 */
+	struct mdinfo info;
+	char nbuf[64];
+	getinfo_super_ddf(st, &info);
+	fname_from_uuid(st, &info, nbuf, ':');
+
+	printf("ARRAY metadata=ddf UUID=%s\n", nbuf + 5);
+}
+
+static void brief_examine_subarrays_ddf(struct supertype *st, int verbose)
+{
+	/* We just write a generic DDF ARRAY entry
+	 */
 	struct ddf_super *ddf = st->sb;
 	struct mdinfo info;
 	int i;
@@ -1203,7 +1215,6 @@ static void brief_examine_super_ddf(struct supertype *st, int verbose)
 		printf("ARRAY container=%s member=%d UUID=%s\n",
 		       nbuf+5, i, nbuf1+5);
 	}
-	printf("ARRAY metadata=ddf UUID=%s\n", nbuf + 5);
 }
 
 static void export_examine_super_ddf(struct supertype *st)
@@ -3597,6 +3608,7 @@ struct superswitch super_ddf = {
 #ifndef	MDASSEMBLE
 	.examine_super	= examine_super_ddf,
 	.brief_examine_super = brief_examine_super_ddf,
+	.brief_examine_subarrays = brief_examine_subarrays_ddf,
 	.export_examine_super = export_examine_super_ddf,
 	.detail_super	= detail_super_ddf,
 	.brief_detail_super = brief_detail_super_ddf,
super-intel.c +18 -3
index dc0c9c0..782519e 100644
@@ -761,9 +761,7 @@ static void brief_examine_super_imsm(struct supertype *st, int verbose)
 	/* We just write a generic IMSM ARRAY entry */
 	struct mdinfo info;
 	char nbuf[64];
-	char nbuf1[64];
 	struct intel_super *super = st->sb;
-	int i;
 
 	if (!super->anchor->num_raid_devs) {
 		printf("ARRAY metadata=imsm\n");
@@ -772,6 +770,23 @@ static void brief_examine_super_imsm(struct supertype *st, int verbose)
 
 	getinfo_super_imsm(st, &info);
 	fname_from_uuid(st, &info, nbuf, ':');
+	printf("ARRAY metadata=imsm UUID=%s\n", nbuf + 5);
+}
+
+static void brief_examine_subarrays_imsm(struct supertype *st, int verbose)
+{
+	/* We just write a generic IMSM ARRAY entry */
+	struct mdinfo info;
+	char nbuf[64];
+	char nbuf1[64];
+	struct intel_super *super = st->sb;
+	int i;
+
+	if (!super->anchor->num_raid_devs)
+		return;
+
+	getinfo_super_imsm(st, &info);
+	fname_from_uuid(st, &info, nbuf, ':');
 	for (i = 0; i < super->anchor->num_raid_devs; i++) {
 		struct imsm_dev *dev = get_imsm_dev(super, i);
 
@@ -781,7 +796,6 @@ static void brief_examine_super_imsm(struct supertype *st, int verbose)
 		printf("ARRAY /dev/md/%.16s container=%s member=%d UUID=%s\n",
 		       dev->volume, nbuf + 5, i, nbuf1 + 5);
 	}
-	printf("ARRAY metadata=imsm UUID=%s\n", nbuf + 5);
 }
 
 static void export_examine_super_imsm(struct supertype *st)
@@ -4554,6 +4568,7 @@ struct superswitch super_imsm = {
 #ifndef	MDASSEMBLE
 	.examine_super	= examine_super_imsm,
 	.brief_examine_super = brief_examine_super_imsm,
+	.brief_examine_subarrays = brief_examine_subarrays_imsm,
 	.export_examine_super = export_examine_super_imsm,
 	.detail_super	= detail_super_imsm,
 	.brief_detail_super = brief_detail_super_imsm,
#2 lore raw
Quoted 22 lines · Neil Brown
Quoted 11 lines · On Tuesday August 4, [email protected] wrote:

The following changes since commit fa09d4961e5c72da3c7f78d53a7d64f5196110a3:
  NeilBrown (1):
        Examine: fix --examine --brief --verbose on containers.

are available in the git repository at:

  git://github.com/djbw/mdadm.git master

Dan Williams (10):
      teach imsm and ddf what st->subarray means at load_super time fix RebuildMap() to retrieve 'subarray' info

Thanks.  I've pulled and pushed them all, but I'm not quite sure of this one.
What metadata information do we want to have in the map file? The main use of the map file is for incremental assembly.  When we find a device, the map file tells us which array/container to attach the device to.
So subarrays probably aren't important in the map file and maybe shouldn't be stored there at all???

Quoted 1 line

What was the context where the current behaviour became an issue?

This was noticed when debugging why udev sometimes did not create a device node for an imsm container. The fix for that was to update the container UUID after adding a subarray. It was during this debug that I noticed that -Ir would not recreate the same map file as -C, so I fixed it for consistency. Now that I look, we are currently using the mapfile to look up the user-friendly device name for "--detail --export". So it is currently needed until we can transition to the named device support you added in 2.6.29.

Quoted 7 lines
Quoted 5 lines

Hi Neil,

This is the same queue that was sent previously [1], but with a few additions:

Sorry I didn't respond to that - late June was a bad time for me :-(

Not a problem.

Quoted 8 lines
Quoted 7 lines

Lastly, I notice that there is a regression of sorts since commit fa09d496 "Examine: fix --examine --brief --verbose on containers". Changing the order of containers and members confuses mdadm -Asc, or -As when /etc/mdadm.conf is present.  We now only get the container, and no members in the multiple container case.  Unintended consequence?

Quoted 6 lines

Certainly unintended.  I guess I had forgotten that the order of things in mdadm.conf is important.
Maybe the best approach would be for Examine.c to call in to the metadata handler a second time to get the subarrays.

What would you think of something like the following?

Works for me, and you already committed it because I was too slow to respond, sorry about that.

Thanks,
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html