Assorted fixes...
Signed-off-by: Neil Brown <neilb@suse.de>
This commit is contained in:
parent
d2cd3ffc02
commit
838acbc272
|
@ -219,7 +219,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
|
||||||
}
|
}
|
||||||
if (dfd >= 0) close(dfd);
|
if (dfd >= 0) close(dfd);
|
||||||
|
|
||||||
if (ident->uuid_set && (!update && strcmp(update, "uuid")!= 0) &&
|
if (ident->uuid_set && (!update || strcmp(update, "uuid")!= 0) &&
|
||||||
(!super || same_uuid(info.uuid, ident->uuid, tst->ss->swapuuid)==0)) {
|
(!super || same_uuid(info.uuid, ident->uuid, tst->ss->swapuuid)==0)) {
|
||||||
if ((inargv && verbose >= 0) || verbose > 0)
|
if ((inargv && verbose >= 0) || verbose > 0)
|
||||||
fprintf(stderr, Name ": %s has wrong uuid.\n",
|
fprintf(stderr, Name ": %s has wrong uuid.\n",
|
||||||
|
@ -266,6 +266,8 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
|
||||||
free(first_super);
|
free(first_super);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
st = tst; /* commit to this format, if haven't already */
|
st = tst; /* commit to this format, if haven't already */
|
||||||
if (st->ss->compare_super(&first_super, super)) {
|
if (st->ss->compare_super(&first_super, super)) {
|
||||||
fprintf(stderr, Name ": superblock on %s doesn't match others - assembly aborted\n",
|
fprintf(stderr, Name ": superblock on %s doesn't match others - assembly aborted\n",
|
||||||
|
|
2
Create.c
2
Create.c
|
@ -364,7 +364,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
|
||||||
array.nr_disks = array.working_disks + array.failed_disks;
|
array.nr_disks = array.working_disks + array.failed_disks;
|
||||||
array.layout = layout;
|
array.layout = layout;
|
||||||
array.chunk_size = chunk*1024;
|
array.chunk_size = chunk*1024;
|
||||||
|
array.major_version = st->ss->major;
|
||||||
|
|
||||||
if (!st->ss->init_super(st, &super, &array, name))
|
if (!st->ss->init_super(st, &super, &array, name))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
19
TODO
19
TODO
|
@ -1,3 +1,22 @@
|
||||||
|
2005-dec-20
|
||||||
|
Want an incremental assembly mode to work nicely with udev.
|
||||||
|
Core usage would be something like
|
||||||
|
mdadm --incr-assemble /dev/newdevice
|
||||||
|
This would
|
||||||
|
- examine the device to determine uuid etc.
|
||||||
|
- look for a match in /etc/mdadm.conf, abort if not found
|
||||||
|
- find that device and collect current contents
|
||||||
|
- perform an 'assemble' analysis to make sure we have the best set of devices.
|
||||||
|
- remove or add devices as appropriate
|
||||||
|
- possibly start the array if it was complete
|
||||||
|
|
||||||
|
Other usages could involve
|
||||||
|
- specify which array to auto-add to.
|
||||||
|
This requires an existing array for uuid matching... is there any point?
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
|
||||||
2004-june-02
|
2004-june-02
|
||||||
* Don't print 'errors' flag, it is meaningless. DONE
|
* Don't print 'errors' flag, it is meaningless. DONE
|
||||||
* Handle new superblock format
|
* Handle new superblock format
|
||||||
|
|
5
bitmap.c
5
bitmap.c
|
@ -126,8 +126,13 @@ bitmap_info_t *bitmap_fd_read(int fd, int brief)
|
||||||
|
|
||||||
info = malloc(sizeof(*info));
|
info = malloc(sizeof(*info));
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
|
#if __GNUC__ < 3
|
||||||
|
fprintf(stderr, Name ": failed to allocate %d bytes\n",
|
||||||
|
(int)sizeof(*info));
|
||||||
|
#else
|
||||||
fprintf(stderr, Name ": failed to allocate %zd bytes\n",
|
fprintf(stderr, Name ": failed to allocate %zd bytes\n",
|
||||||
sizeof(*info));
|
sizeof(*info));
|
||||||
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
mdadm.h
4
mdadm.h
|
@ -211,6 +211,10 @@ struct supertype {
|
||||||
extern struct supertype *super_by_version(int vers, int minor);
|
extern struct supertype *super_by_version(int vers, int minor);
|
||||||
extern struct supertype *guess_super(int fd);
|
extern struct supertype *guess_super(int fd);
|
||||||
|
|
||||||
|
#if __GNUC__ < 3
|
||||||
|
struct stat64;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef UCLIBC
|
#ifdef UCLIBC
|
||||||
struct FTW {};
|
struct FTW {};
|
||||||
# define FTW_PHYS 1
|
# define FTW_PHYS 1
|
||||||
|
|
2
super1.c
2
super1.c
|
@ -396,7 +396,7 @@ static int update_super1(struct mdinfo *info, void *sbv, char *update, char *dev
|
||||||
sb->resync_offset = ~0ULL;
|
sb->resync_offset = ~0ULL;
|
||||||
}
|
}
|
||||||
if (strcmp(update, "uuid") == 0)
|
if (strcmp(update, "uuid") == 0)
|
||||||
memcmp(sb->set_uuid, info->uuid, 16);
|
memcpy(sb->set_uuid, info->uuid, 16);
|
||||||
|
|
||||||
sb->sb_csum = calc_sb_1_csum(sb);
|
sb->sb_csum = calc_sb_1_csum(sb);
|
||||||
return rv;
|
return rv;
|
||||||
|
|
Loading…
Reference in New Issue