+2010-08-02 Colin Watson <cjwatson@ubuntu.com>
+
+ * disk/raid.c (insert_array): Select unique numbers for named arrays
+ as well, for use as keys in the disk cache.
+
2010-08-01 Robert Millan <rmh@gnu.org>
* util/grub.d/10_kfreebsd.in: Initialize ${kfreebsd_device} as the
grub_memset (&array->device, 0, sizeof (array->device));
grub_memset (&array->start_sector, 0, sizeof (array->start_sector));
- if (array->name)
- goto skip_duplicate_check;
- /* Check whether we don't have multiple arrays with the same number. */
- for (p = array_list; p != NULL; p = p->next)
- {
- if (! p->name && p->number == array->number)
- break;
- }
+ if (! array->name)
+ {
+ for (p = array_list; p != NULL; p = p->next)
+ {
+ if (! p->name && p->number == array->number)
+ break;
+ }
+ }
- if (p)
+ if (array->name || p)
{
- /* The number is already in use, so we need to find a new one. */
- int i = 0;
+ /* The number is already in use, so we need to find a new one.
+ (Or, in the case of named arrays, the array doesn't have its
+ own number, but we need one that doesn't clash for use as a key
+ in the disk cache. */
+ int i = array->name ? 0x40000000 : 0;
while (1)
{
for (p = array_list; p != NULL; p = p->next)
{
- if (! p->name && p->number == i)
+ if (p->number == i)
break;
}
i++;
}
}
- skip_duplicate_check:
+
/* mdraid 1.x superblocks have only a name stored not a number.
Use it directly as GRUB device. */
if (! array->name)