mdadm/mdadm-2.6.2-create.patch
Doug Ledford fd828476e8 - Fix a file leak issue when mdadm is in monitor mode
- Update mdadm init script so that status will always run and so return
    codes are standards compliant
- Fix assembly of version 1 superblock devices
- Make the attempt to create an already running device have a clearer error
    message
- Allow the creation of a degraded raid4 array like we allow for raid5
- Make mdadm actually pay attention to raid4 devices when in monitor mode
- Make the mdmonitor script use daemon() correctly
- Fix a bug where manage mode would not add disks correctly under certain
    conditions
- Resolves: bz244582, bz242688, bz230207, bz169596, bz171862, bz171938
- Resolves: bz174642, bz224272, bz186524
2007-07-03 20:04:11 +00:00

27 lines
907 B
Diff

--- mdadm-2.6.2/Create.c.info 2007-07-03 10:18:38.000000000 -0400
+++ mdadm-2.6.2/Create.c 2007-07-03 11:06:23.000000000 -0400
@@ -81,6 +81,14 @@ int Create(struct supertype *st, char *m
if (vers < 9000) {
fprintf(stderr, Name ": Create requires md driver version 0.90.0 or later\n");
return 1;
+ } else {
+ mdu_array_info_t inf;
+ memset(&inf, 0, sizeof(inf));
+ ioctl(mdfd, GET_ARRAY_INFO, &inf);
+ if (inf.working_disks != 0) {
+ fprintf(stderr, Name ": another array by this name already running.\n");
+ return 1;
+ }
}
if (level == UnSet) {
fprintf(stderr,
@@ -225,7 +233,7 @@ int Create(struct supertype *st, char *m
}
if (st->ss->major != 0 ||
st->minor_version != 90)
- fprintf(stderr, Name ": Defaulting to verion %d.%d metadata\n",
+ fprintf(stderr, Name ": Defaulting to version %d.%d metadata\n",
st->ss->major,
st->minor_version);
}