Assorted fixes...
Signed-off-by: Neil Brown <neilb@suse.de>
Neil Brown
18 years ago
218 | 218 |
}
|
219 | 219 |
if (dfd >= 0) close(dfd);
|
220 | 220 |
|
221 | |
if (ident->uuid_set && (!update && strcmp(update, "uuid")!= 0) &&
|
|
221 |
if (ident->uuid_set && (!update || strcmp(update, "uuid")!= 0) &&
|
222 | 222 |
(!super || same_uuid(info.uuid, ident->uuid, tst->ss->swapuuid)==0)) {
|
223 | 223 |
if ((inargv && verbose >= 0) || verbose > 0)
|
224 | 224 |
fprintf(stderr, Name ": %s has wrong uuid.\n",
|
|
265 | 265 |
free(first_super);
|
266 | 266 |
return 1;
|
267 | 267 |
}
|
|
268 |
|
|
269 |
|
268 | 270 |
st = tst; /* commit to this format, if haven't already */
|
269 | 271 |
if (st->ss->compare_super(&first_super, super)) {
|
270 | 272 |
fprintf(stderr, Name ": superblock on %s doesn't match others - assembly aborted\n",
|
363 | 363 |
array.nr_disks = array.working_disks + array.failed_disks;
|
364 | 364 |
array.layout = layout;
|
365 | 365 |
array.chunk_size = chunk*1024;
|
366 | |
|
|
366 |
array.major_version = st->ss->major;
|
367 | 367 |
|
368 | 368 |
if (!st->ss->init_super(st, &super, &array, name))
|
369 | 369 |
return 1;
|
|
0 |
2005-dec-20
|
|
1 |
Want an incremental assembly mode to work nicely with udev.
|
|
2 |
Core usage would be something like
|
|
3 |
mdadm --incr-assemble /dev/newdevice
|
|
4 |
This would
|
|
5 |
- examine the device to determine uuid etc.
|
|
6 |
- look for a match in /etc/mdadm.conf, abort if not found
|
|
7 |
- find that device and collect current contents
|
|
8 |
- perform an 'assemble' analysis to make sure we have the best set of devices.
|
|
9 |
- remove or add devices as appropriate
|
|
10 |
- possibly start the array if it was complete
|
|
11 |
|
|
12 |
Other usages could involve
|
|
13 |
- specify which array to auto-add to.
|
|
14 |
This requires an existing array for uuid matching... is there any point?
|
|
15 |
|
|
16 |
-
|
|
17 |
|
|
18 |
|
0 | 19 |
2004-june-02
|
1 | 20 |
* Don't print 'errors' flag, it is meaningless. DONE
|
2 | 21 |
* Handle new superblock format
|
125 | 125 |
|
126 | 126 |
info = malloc(sizeof(*info));
|
127 | 127 |
if (info == NULL) {
|
|
128 |
#if __GNUC__ < 3
|
|
129 |
fprintf(stderr, Name ": failed to allocate %d bytes\n",
|
|
130 |
(int)sizeof(*info));
|
|
131 |
#else
|
128 | 132 |
fprintf(stderr, Name ": failed to allocate %zd bytes\n",
|
129 | 133 |
sizeof(*info));
|
|
134 |
#endif
|
130 | 135 |
return NULL;
|
131 | 136 |
}
|
132 | 137 |
|
210 | 210 |
extern struct supertype *super_by_version(int vers, int minor);
|
211 | 211 |
extern struct supertype *guess_super(int fd);
|
212 | 212 |
|
|
213 |
#if __GNUC__ < 3
|
|
214 |
struct stat64;
|
|
215 |
#endif
|
|
216 |
|
213 | 217 |
#ifdef UCLIBC
|
214 | 218 |
struct FTW {};
|
215 | 219 |
# define FTW_PHYS 1
|
395 | 395 |
sb->resync_offset = ~0ULL;
|
396 | 396 |
}
|
397 | 397 |
if (strcmp(update, "uuid") == 0)
|
398 | |
memcmp(sb->set_uuid, info->uuid, 16);
|
|
398 |
memcpy(sb->set_uuid, info->uuid, 16);
|
399 | 399 |
|
400 | 400 |
sb->sb_csum = calc_sb_1_csum(sb);
|
401 | 401 |
return rv;
|