]>
git.ipfire.org Git - thirdparty/mdadm.git/blob - Incremental.c
2 * Incremental.c - support --incremental. Part of:
3 * mdadm - manage Linux "md" devices aka RAID arrays.
5 * Copyright (C) 2006 Neil Brown <neilb@suse.de>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * Email: <neilb@suse.de>
27 * QVB Post Office, NSW 1230
33 static int count_active(struct supertype
*st
, int mdfd
, char **availp
,
35 static void find_reject(int mdfd
, struct supertype
*st
, struct mdinfo
*sra
,
36 int number
, __u64 events
, int verbose
,
39 int Incremental(char *devname
, int verbose
, int runstop
,
40 struct supertype
*st
, char *homehost
, int autof
)
42 /* Add this device to an array, creating the array if necessary
43 * and starting the array if sensible or - if runstop>0 - if possible.
45 * This has several steps:
47 * 1/ Check if device is permitted by mdadm.conf, reject if not.
48 * 2/ Find metadata, reject if none appropriate (check
49 * version/name from args)
50 * 3/ Check if there is a match in mdadm.conf
51 * 3a/ if not, check for homehost match. If no match, reject.
52 * 4/ Determine device number.
53 * - If in mdadm.conf with std name, use that
54 * - UUID in /var/run/mdadm.map use that
55 * - If name is suggestive, use that. unless in use with different uuid.
56 * - Choose a free, high number.
57 * - Use a partitioned device unless strong suggestion not to.
59 * Don't choose partitioned for containers.
60 * 5/ Find out if array already exists
62 * - choose a name, from mdadm.conf or 'name' field in array.
66 * - check one drive in array to make sure metadata is a reasonably
67 * close match. Reject if not (e.g. different type)
69 * 6/ Make sure /var/run/mdadm.map contains this array.
70 * 7/ Is there enough devices to possibly start the array?
71 * For a container, this means running Incremental_container.
72 * 7a/ if not, finish with success.
74 * - read all metadata and arrange devices like -A does
75 * - if number of OK devices match expected, or -R and there are enough,
76 * start the array (auto-readonly).
80 struct mddev_ident_s
*array_list
, *match
;
81 char chosen_name
[1024];
84 struct map_ent
*mp
, *map
= NULL
;
88 int uuid_for_name
= 0;
92 struct createinfo
*ci
= conf_get_create_info();
97 /* 1/ Check if device is permitted by mdadm.conf */
99 if (!conf_test_dev(devname
)) {
102 ": %s not permitted by mdadm.conf.\n",
107 /* 2/ Find metadata, reject if none appropriate (check
108 * version/name from args) */
110 dfd
= dev_open(devname
, O_RDONLY
|O_EXCL
);
113 fprintf(stderr
, Name
": cannot open %s: %s.\n",
114 devname
, strerror(errno
));
117 if (fstat(dfd
, &stb
) < 0) {
119 fprintf(stderr
, Name
": fstat failed for %s: %s.\n",
120 devname
, strerror(errno
));
124 if ((stb
.st_mode
& S_IFMT
) != S_IFBLK
) {
126 fprintf(stderr
, Name
": %s is not a block device.\n",
132 if (st
== NULL
&& (st
= guess_super(dfd
)) == NULL
) {
135 ": no recognisable superblock on %s.\n",
140 if (st
->ss
->load_super(st
, dfd
, NULL
)) {
142 fprintf(stderr
, Name
": no RAID superblock on %s.\n",
149 if (st
->ss
->container_content
&& st
->loaded_container
) {
150 /* This is a pre-built container array, so we do something
153 return Incremental_container(st
, devname
, verbose
, runstop
,
157 memset(&info
, 0, sizeof(info
));
158 st
->ss
->getinfo_super(st
, &info
);
159 /* 3/ Check if there is a match in mdadm.conf */
161 array_list
= conf_get_ident(NULL
);
163 for (; array_list
; array_list
= array_list
->next
) {
164 if (array_list
->uuid_set
&&
165 same_uuid(array_list
->uuid
, info
.uuid
, st
->ss
->swapuuid
)
169 ": UUID differs from %s.\n",
170 array_list
->devname
);
173 if (array_list
->name
[0] &&
174 strcasecmp(array_list
->name
, info
.name
) != 0) {
177 ": Name differs from %s.\n",
178 array_list
->devname
);
181 if (array_list
->devices
&&
182 !match_oneof(array_list
->devices
, devname
)) {
185 ": Not a listed device for %s.\n",
186 array_list
->devname
);
189 if (array_list
->super_minor
!= UnSet
&&
190 array_list
->super_minor
!= info
.array
.md_minor
) {
193 ": Different super-minor to %s.\n",
194 array_list
->devname
);
197 if (!array_list
->uuid_set
&&
198 !array_list
->name
[0] &&
199 !array_list
->devices
&&
200 array_list
->super_minor
== UnSet
) {
203 ": %s doesn't have any identifying information.\n",
204 array_list
->devname
);
207 /* FIXME, should I check raid_disks and level too?? */
212 ": we match both %s and %s - cannot decide which to use.\n",
213 match
->devname
, array_list
->devname
);
219 /* 3a/ if not, check for homehost match. If no match, reject. */
221 if (homehost
== NULL
||
222 st
->ss
->match_home(st
, homehost
) != 1)
225 /* 4/ Determine device number. */
226 /* - If in mdadm.conf with std name, use that */
227 /* - UUID in /var/run/mdadm.map use that */
228 /* - If name is suggestive, use that. unless in use with */
229 /* different uuid. */
230 /* - Choose a free, high number. */
231 /* - Use a partitioned device unless strong suggestion not to. */
233 mp
= map_by_uuid(&map
, info
.uuid
);
235 if (uuid_for_name
&& ! mp
) {
236 name_to_use
= fname_from_uuid(st
, &info
, nbuf
, '-');
239 ": not found in mdadm.conf and not identified by homehost"
240 " - using uuid based name\n");
242 name_to_use
= info
.name
;
244 if (match
&& is_standard(match
->devname
, &devnum
))
245 /* We have devnum now */;
249 /* Have to guess a bit. */
250 int use_partitions
= 1;
252 char *nm
, nbuf
[1024];
255 if ((autof
&7) == 3 || (autof
&7) == 5)
257 if (st
->ss
->external
)
259 np
= strchr(name_to_use
, ':');
264 devnum
= strtoul(np
, &ep
, 10);
265 if (ep
> np
&& *ep
== 0) {
266 /* This is a number. Let check that it is unused. */
267 if (mddev_busy(use_partitions
? (-1-devnum
) : devnum
))
275 sprintf(nbuf
, "/dev/md/%s", np
);
278 if (stat(nm
, &stb2
) == 0 &&
279 S_ISBLK(stb2
.st_mode
) &&
280 major(stb2
.st_rdev
) == (use_partitions
?
281 get_mdp_major() : MD_MAJOR
)) {
283 devnum
= minor(stb2
.st_rdev
) >> MdpMinorShift
;
285 devnum
= minor(stb2
.st_rdev
);
286 if (mddev_busy(use_partitions
? (-1-devnum
) : devnum
))
291 /* Haven't found anything yet, choose something free */
292 devnum
= find_free_devnum(use_partitions
);
294 if (devnum
== NoMdDev
) {
296 ": No spare md devices!!\n");
300 devnum
= use_partitions
? (-1-devnum
) : devnum
;
303 mdfd
= open_mddev_devnum(match
? match
->devname
: mp
? mp
->path
: NULL
,
306 chosen_name
, autof
>> 3);
308 fprintf(stderr
, Name
": failed to open %s: %s.\n",
309 chosen_name
, strerror(errno
));
312 sysfs_init(&info
, mdfd
, 0);
314 /* 5/ Find out if array already exists */
315 if (! mddev_busy(devnum
)) {
316 /* 5a/ if it does not */
317 /* - choose a name, from mdadm.conf or 'name' field in array. */
318 /* - create the array */
319 /* - add the device */
323 if (set_array_info(mdfd
, st
, &info
) != 0) {
324 fprintf(stderr
, Name
": failed to set array info for %s: %s\n",
325 chosen_name
, strerror(errno
));
331 dinfo
.disk
.major
= major(stb
.st_rdev
);
332 dinfo
.disk
.minor
= minor(stb
.st_rdev
);
333 if (add_disk(mdfd
, st
, &info
, &dinfo
) != 0) {
334 fprintf(stderr
, Name
": failed to add %s to %s: %s.\n",
335 devname
, chosen_name
, strerror(errno
));
336 ioctl(mdfd
, STOP_ARRAY
, 0);
340 sra
= sysfs_read(mdfd
, devnum
, GET_DEVS
);
341 if (!sra
|| !sra
->devs
|| sra
->devs
->disk
.raid_disk
>= 0) {
342 /* It really should be 'none' - must be old buggy
343 * kernel, and mdadm -I may not be able to complete.
346 ioctl(mdfd
, STOP_ARRAY
, NULL
);
348 ": You have an old buggy kernel which cannot support\n"
349 " --incremental reliably. Aborting.\n");
354 info
.array
.working_disks
= 1;
358 /* - check one drive in array to make sure metadata is a reasonably */
359 /* close match. Reject if not (e.g. different type) */
360 /* - add the device */
365 struct supertype
*st2
;
366 struct mdinfo info2
, *d
;
367 sra
= sysfs_read(mdfd
, devnum
, (GET_DEVS
| GET_STATE
));
369 sprintf(dn
, "%d:%d", sra
->devs
->disk
.major
,
370 sra
->devs
->disk
.minor
);
371 dfd2
= dev_open(dn
, O_RDONLY
);
373 if (st2
->ss
->load_super(st2
, dfd2
, NULL
) ||
374 st
->ss
->compare_super(st
, st2
) != 0) {
376 ": metadata mismatch between %s and "
378 devname
, chosen_name
);
384 memset(&info2
, 0, sizeof(info2
));
385 st2
->ss
->getinfo_super(st2
, &info2
);
386 st2
->ss
->free_super(st2
);
387 if (info
.array
.level
!= info2
.array
.level
||
388 memcmp(info
.uuid
, info2
.uuid
, 16) != 0 ||
389 info
.array
.raid_disks
!= info2
.array
.raid_disks
) {
391 ": unexpected difference between %s and %s.\n",
392 chosen_name
, devname
);
396 info2
.disk
.major
= major(stb
.st_rdev
);
397 info2
.disk
.minor
= minor(stb
.st_rdev
);
398 /* add disk needs to know about containers */
399 if (st
->ss
->external
)
400 sra
->array
.level
= LEVEL_CONTAINER
;
401 err
= add_disk(mdfd
, st2
, sra
, &info2
);
402 if (err
< 0 && errno
== EBUSY
) {
403 /* could be another device present with the same
404 * disk.number. Find and reject any such
406 find_reject(mdfd
, st
, sra
, info
.disk
.number
,
407 info
.events
, verbose
, chosen_name
);
408 err
= add_disk(mdfd
, st2
, sra
, &info2
);
411 fprintf(stderr
, Name
": failed to add %s to %s: %s.\n",
412 devname
, chosen_name
, strerror(errno
));
416 info
.array
.working_disks
= 0;
417 for (d
= sra
->devs
; d
; d
=d
->next
)
418 info
.array
.working_disks
++;
421 /* 6/ Make sure /var/run/mdadm.map contains this array. */
422 map_update(&map
, devnum
,
424 info
.uuid
, chosen_name
);
426 /* 7/ Is there enough devices to possibly start the array? */
427 /* 7a/ if not, finish with success. */
428 if (info
.array
.level
== LEVEL_CONTAINER
) {
429 /* Try to assemble within the container */
433 ": container %s now has %d devices\n",
434 chosen_name
, info
.array
.working_disks
);
435 return Incremental(chosen_name
, verbose
, runstop
,
436 NULL
, homehost
, autof
);
439 active_disks
= count_active(st
, mdfd
, &avail
, &info
);
440 if (enough(info
.array
.level
, info
.array
.raid_disks
,
441 info
.array
.layout
, info
.array
.state
& 1,
442 avail
, active_disks
) == 0) {
446 ": %s attached to %s, not enough to start (%d).\n",
447 devname
, chosen_name
, active_disks
);
454 /* - if number of OK devices match expected, or -R and there */
456 /* + add any bitmap file */
457 /* + start the array (auto-readonly). */
459 mdu_array_info_t ainf
;
461 if (ioctl(mdfd
, GET_ARRAY_INFO
, &ainf
) == 0) {
464 ": %s attached to %s which is already active.\n",
465 devname
, chosen_name
);
470 if (runstop
> 0 || active_disks
>= info
.array
.working_disks
) {
472 /* Let's try to start it */
473 if (match
&& match
->bitmap_file
) {
474 int bmfd
= open(match
->bitmap_file
, O_RDWR
);
477 ": Could not open bitmap file %s.\n",
482 if (ioctl(mdfd
, SET_BITMAP_FILE
, bmfd
) != 0) {
485 ": Failed to set bitmapfile for %s.\n",
492 sra
= sysfs_read(mdfd
, devnum
, 0);
493 if (sra
== NULL
|| active_disks
>= info
.array
.working_disks
)
494 rv
= ioctl(mdfd
, RUN_ARRAY
, NULL
);
496 rv
= sysfs_set_str(sra
, NULL
,
497 "array_state", "read-auto");
501 ": %s attached to %s, which has been started.\n",
502 devname
, chosen_name
);
506 ": %s attached to %s, but failed to start: %s.\n",
507 devname
, chosen_name
, strerror(errno
));
513 ": %s attached to %s, not enough to start safely.\n",
514 devname
, chosen_name
);
521 static void find_reject(int mdfd
, struct supertype
*st
, struct mdinfo
*sra
,
522 int number
, __u64 events
, int verbose
,
525 /* Find a device attached to this array with a disk.number of number
526 * and events less than the passed events, and remove the device.
531 if (ioctl(mdfd
, GET_ARRAY_INFO
, &ra
) == 0)
532 return; /* not safe to remove from active arrays
533 * without thinking more */
535 for (d
= sra
->devs
; d
; d
= d
->next
) {
539 sprintf(dn
, "%d:%d", d
->disk
.major
, d
->disk
.minor
);
540 dfd
= dev_open(dn
, O_RDONLY
);
543 if (st
->ss
->load_super(st
, dfd
, NULL
)) {
547 st
->ss
->getinfo_super(st
, &info
);
548 st
->ss
->free_super(st
);
551 if (info
.disk
.number
!= number
||
552 info
.events
>= events
)
555 if (d
->disk
.raid_disk
> -1)
556 sysfs_set_str(sra
, d
, "slot", "none");
557 if (sysfs_set_str(sra
, d
, "state", "remove") == 0)
560 ": removing old device %s from %s\n",
561 d
->sys_name
+4, array_name
);
565 static int count_active(struct supertype
*st
, int mdfd
, char **availp
,
566 struct mdinfo
*bestinfo
)
568 /* count how many devices in sra think they are active */
570 int cnt
= 0, cnt1
= 0;
571 __u64 max_events
= 0;
572 struct mdinfo
*sra
= sysfs_read(mdfd
, -1, GET_DEVS
| GET_STATE
);
575 for (d
= sra
->devs
; d
; d
= d
->next
) {
581 sprintf(dn
, "%d:%d", d
->disk
.major
, d
->disk
.minor
);
582 dfd
= dev_open(dn
, O_RDONLY
);
585 ok
= st
->ss
->load_super(st
, dfd
, NULL
);
589 st
->ss
->getinfo_super(st
, &info
);
590 if (info
.disk
.state
& (1<<MD_DISK_SYNC
))
593 avail
= malloc(info
.array
.raid_disks
);
594 memset(avail
, 0, info
.array
.raid_disks
);
598 max_events
= info
.events
;
599 avail
[info
.disk
.raid_disk
] = 2;
600 st
->ss
->getinfo_super(st
, bestinfo
);
601 } else if (info
.events
== max_events
) {
603 avail
[info
.disk
.raid_disk
] = 2;
604 } else if (info
.events
== max_events
-1) {
606 avail
[info
.disk
.raid_disk
] = 1;
607 } else if (info
.events
< max_events
- 1)
609 else if (info
.events
== max_events
+1) {
613 max_events
= info
.events
;
614 for (i
=0; i
<info
.array
.raid_disks
; i
++)
617 avail
[info
.disk
.raid_disk
] = 2;
618 st
->ss
->getinfo_super(st
, bestinfo
);
619 } else { /* info.events much bigger */
621 memset(avail
, 0, info
.disk
.raid_disk
);
622 max_events
= info
.events
;
623 st
->ss
->getinfo_super(st
, bestinfo
);
626 st
->ss
->free_super(st
);
631 void RebuildMap(void)
633 struct mdstat_ent
*mdstat
= mdstat_read(0, 0);
634 struct mdstat_ent
*md
;
635 struct map_ent
*map
= NULL
;
636 int mdp
= get_mdp_major();
638 for (md
= mdstat
; md
; md
= md
->next
) {
639 struct mdinfo
*sra
= sysfs_read(-1, md
->devnum
, GET_DEVS
);
642 for (sd
= sra
->devs
; sd
; sd
= sd
->next
) {
646 struct supertype
*st
;
650 sprintf(dn
, "%d:%d", sd
->disk
.major
, sd
->disk
.minor
);
651 dfd
= dev_open(dn
, O_RDONLY
);
654 st
= guess_super(dfd
);
658 ok
= st
->ss
->load_super(st
, dfd
, NULL
);
662 st
->ss
->getinfo_super(st
, &info
);
664 path
= map_dev(MD_MAJOR
, md
->devnum
, 0);
666 path
= map_dev(mdp
, (-1-md
->devnum
)<< 6, 0);
667 map_add(&map
, md
->devnum
,
669 info
.uuid
, path
? : "/unknown");
670 st
->ss
->free_super(st
);
678 int IncrementalScan(int verbose
)
680 /* look at every device listed in the 'map' file.
681 * If one is found that is not running then:
682 * look in mdadm.conf for bitmap file.
683 * if one exists, but array has none, add it.
684 * try to start array in auto-readonly mode
686 struct map_ent
*mapl
= NULL
;
688 mddev_ident_t devs
, mddev
;
692 devs
= conf_get_ident(NULL
);
694 for (me
= mapl
; me
; me
= me
->next
) {
696 mdu_array_info_t array
;
697 mdu_bitmap_file_t bmf
;
699 int mdfd
= open_mddev_devnum(me
->path
, me
->devnum
,
703 if (ioctl(mdfd
, GET_ARRAY_INFO
, &array
) == 0 ||
708 /* Ok, we can try this one. Maybe it needs a bitmap */
709 for (mddev
= devs
; mddev
; mddev
= mddev
->next
)
710 if (strcmp(mddev
->devname
, me
->path
) == 0)
712 if (mddev
&& mddev
->bitmap_file
) {
714 * Note: early kernels will wrongly fail this, so it
718 if (ioctl(mdfd
, GET_ARRAY_INFO
, &bmf
) < 0) {
719 int bmfd
= open(mddev
->bitmap_file
, O_RDWR
);
721 added
= ioctl(mdfd
, SET_BITMAP_FILE
,
729 ": Added bitmap %s to %s\n",
730 mddev
->bitmap_file
, me
->path
);
731 else if (errno
!= EEXIST
)
733 ": Failed to add bitmap to %s: %s\n",
734 me
->path
, strerror(errno
));
737 sra
= sysfs_read(mdfd
, 0, 0);
739 if (sysfs_set_str(sra
, NULL
,
740 "array_state", "read-auto") == 0) {
743 ": started array %s\n",
747 ": failed to start array %s: %s\n",
748 me
->path
, strerror(errno
));
756 static char *container2devname(char *devname
)
758 int fd
= open(devname
, O_RDONLY
);
762 mdname
= devnum2devname(fd2devnum(fd
));
769 int Incremental_container(struct supertype
*st
, char *devname
, int verbose
,
770 int runstop
, int autof
)
772 /* Collect the contents of this container and for each
773 * array, choose a device name and assemble the array.
776 struct mdinfo
*list
= st
->ss
->container_content(st
);
778 char *mdname
= container2devname(devname
);
781 fprintf(stderr
, Name
": failed to determine device name\n");
785 for (ra
= list
; ra
; ra
= ra
->next
) {
786 struct mdinfo
*dev
, *sra
;
789 char chosen_name
[1024];
792 int working
= 0, preexist
= 0;
793 struct map_ent
*mp
, *map
= NULL
;
796 struct mddev_ident_s
*match
= NULL
;
798 if ((autof
&7) == 3 || (autof
&7) == 5)
801 mp
= map_by_uuid(&map
, ra
->uuid
);
803 name_to_use
= ra
->name
;
806 (*devname
!= '/' || strncmp("UUID-", strrchr(devname
,'/')+1,5) == 0)
808 name_to_use
= fname_from_uuid(st
, ra
, nbuf
, '-');
812 /* Check in mdadm.conf for devices == devname and
813 * member == ra->text_version after second slash.
815 char *sub
= strchr(ra
->text_version
+1, '/');
816 struct mddev_ident_s
*array_list
;
819 array_list
= conf_get_ident(NULL
);
822 for(; array_list
; array_list
= array_list
->next
) {
825 if (array_list
->member
== NULL
||
826 array_list
->container
== NULL
)
828 if (strcmp(array_list
->member
, sub
) != 0)
830 fd
= open(array_list
->container
, O_RDONLY
);
833 dn
= devnum2devname(fd2devnum(fd
));
835 if (strncmp(dn
, ra
->text_version
+1,
837 ra
->text_version
[strlen(dn
)+1] != '/') {
842 /* we have a match */
848 if (match
&& is_standard(match
->devname
, &devnum
))
849 /* we have devnum now */;
852 else if (is_standard(name_to_use
, &devnum
))
858 if (*n
&& devnum
< 0) {
859 devnum
= strtoul(n
, &n
, 10);
860 if (devnum
>= 0 && (*n
== 0 || *n
== ' ')) {
861 /* Use this devnum */
862 usepart
= (name_to_use
[0] == 'd');
863 if (mddev_busy(usepart
? (-1-devnum
) : devnum
))
870 char *nm
= name_to_use
;
874 nm
= strchr(nm
, ':')+1;
875 sprintf(nbuf
, "/dev/md/%s", nm
);
877 if (stat(nbuf
, &stb
) == 0 &&
878 S_ISBLK(stb
.st_mode
) &&
879 major(stb
.st_rdev
) == (usepart
?
880 get_mdp_major() : MD_MAJOR
)){
882 devnum
= minor(stb
.st_rdev
)
885 devnum
= minor(stb
.st_rdev
);
886 if (mddev_busy(usepart
? (-1-devnum
) : devnum
))
892 devnum
= usepart
? (-1-devnum
) : devnum
;
894 devnum
= find_free_devnum(usepart
);
896 mdfd
= open_mddev_devnum(mp
? mp
->path
: match
? match
->devname
: NULL
,
898 chosen_name
, autof
>>3);
901 fprintf(stderr
, Name
": failed to open %s: %s.\n",
902 chosen_name
, strerror(errno
));
907 sysfs_init(ra
, mdfd
, 0);
909 sra
= sysfs_read(mdfd
, 0, GET_VERSION
);
910 if (sra
== NULL
|| strcmp(sra
->text_version
, ra
->text_version
) != 0)
911 if (sysfs_set_array(ra
, md_get_version(mdfd
)) != 0)
916 for (dev
= ra
->devs
; dev
; dev
= dev
->next
)
917 if (sysfs_add_disk(ra
, dev
) == 0)
919 else if (errno
== EEXIST
)
922 /* Nothing new, don't try to start */ ;
923 else if (runstop
> 0 ||
924 (working
+ preexist
) >= ra
->array
.working_disks
) {
925 switch(ra
->array
.level
) {
927 case LEVEL_MULTIPATH
:
929 sysfs_set_str(ra
, NULL
, "array_state",
933 sysfs_set_str(ra
, NULL
, "array_state",
935 /* start mdmon if needed. */
936 if (!mdmon_running(st
->container_dev
))
937 start_mdmon(st
->container_dev
);
938 ping_monitor(devnum2devname(st
->container_dev
));
941 sysfs_set_safemode(ra
, ra
->safe_mode_delay
);
944 ": Started %s with %d devices",
945 chosen_name
, working
+ preexist
);
947 fprintf(stderr
, " (%d new)", working
);
948 fprintf(stderr
, "\n");
950 /* FIXME should have an O_EXCL and wait for read-auto */
954 ": %s assembled with %d devices but "
956 chosen_name
, working
);
958 map_update(&map
, devnum
,
960 ra
->uuid
, chosen_name
);