mdadm: Fixup a large number of bad formatting of logical operators
Logical oprators never belong at the beginning of a line. Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
parent
a0628abf2b
commit
fc54fe7a7e
23
Assemble.c
23
Assemble.c
|
@ -753,12 +753,12 @@ static int load_devices(struct devs *devices, char *devmap,
|
||||||
bestcnt = newbestcnt;
|
bestcnt = newbestcnt;
|
||||||
}
|
}
|
||||||
if (best[i] >=0 &&
|
if (best[i] >=0 &&
|
||||||
devices[best[i]].i.events
|
devices[best[i]].i.events ==
|
||||||
== devices[devcnt].i.events
|
devices[devcnt].i.events &&
|
||||||
&& (devices[best[i]].i.disk.minor
|
(devices[best[i]].i.disk.minor
|
||||||
!= devices[devcnt].i.disk.minor)
|
!= devices[devcnt].i.disk.minor) &&
|
||||||
&& st->ss == &super0
|
st->ss == &super0 &&
|
||||||
&& content->array.level != LEVEL_MULTIPATH) {
|
content->array.level != LEVEL_MULTIPATH) {
|
||||||
/* two different devices with identical superblock.
|
/* two different devices with identical superblock.
|
||||||
* Could be a mis-detection caused by overlapping
|
* Could be a mis-detection caused by overlapping
|
||||||
* partitions. fail-safe.
|
* partitions. fail-safe.
|
||||||
|
@ -801,14 +801,11 @@ static int force_array(struct mdinfo *content,
|
||||||
int okcnt = 0;
|
int okcnt = 0;
|
||||||
while (!enough(content->array.level, content->array.raid_disks,
|
while (!enough(content->array.level, content->array.raid_disks,
|
||||||
content->array.layout, 1,
|
content->array.layout, 1,
|
||||||
avail)
|
avail) ||
|
||||||
||
|
|
||||||
(content->reshape_active && content->delta_disks > 0 &&
|
(content->reshape_active && content->delta_disks > 0 &&
|
||||||
!enough(content->array.level, (content->array.raid_disks
|
!enough(content->array.level, (content->array.raid_disks
|
||||||
- content->delta_disks),
|
- content->delta_disks),
|
||||||
content->new_layout, 1,
|
content->new_layout, 1, avail))) {
|
||||||
avail)
|
|
||||||
)) {
|
|
||||||
/* Choose the newest best drive which is
|
/* Choose the newest best drive which is
|
||||||
* not up-to-date, update the superblock
|
* not up-to-date, update the superblock
|
||||||
* and add it.
|
* and add it.
|
||||||
|
@ -1303,8 +1300,8 @@ int Assemble(struct supertype *st, char *mddev,
|
||||||
int mdfd;
|
int mdfd;
|
||||||
int clean;
|
int clean;
|
||||||
int auto_assem = (mddev == NULL && !ident->uuid_set &&
|
int auto_assem = (mddev == NULL && !ident->uuid_set &&
|
||||||
ident->super_minor == UnSet && ident->name[0] == 0
|
ident->super_minor == UnSet && ident->name[0] == 0 &&
|
||||||
&& (ident->container == NULL || ident->member == NULL));
|
(ident->container == NULL || ident->member == NULL));
|
||||||
struct devs *devices;
|
struct devs *devices;
|
||||||
char *devmap;
|
char *devmap;
|
||||||
int *best = NULL; /* indexed by raid_disk */
|
int *best = NULL; /* indexed by raid_disk */
|
||||||
|
|
34
Grow.c
34
Grow.c
|
@ -813,8 +813,8 @@ static void unfreeze(struct supertype *st)
|
||||||
char buf[20];
|
char buf[20];
|
||||||
|
|
||||||
if (sra &&
|
if (sra &&
|
||||||
sysfs_get_str(sra, NULL, "sync_action", buf, 20) > 0
|
sysfs_get_str(sra, NULL, "sync_action", buf, 20) > 0 &&
|
||||||
&& strcmp(buf, "frozen\n") == 0)
|
strcmp(buf, "frozen\n") == 0)
|
||||||
sysfs_set_str(sra, NULL, "sync_action", "idle");
|
sysfs_set_str(sra, NULL, "sync_action", "idle");
|
||||||
sysfs_free(sra);
|
sysfs_free(sra);
|
||||||
}
|
}
|
||||||
|
@ -2902,8 +2902,8 @@ static int impose_level(int fd, int level, char *devname, int verbose)
|
||||||
if (disk.major == 0 && disk.minor == 0)
|
if (disk.major == 0 && disk.minor == 0)
|
||||||
continue;
|
continue;
|
||||||
found++;
|
found++;
|
||||||
if ((disk.state & (1 << MD_DISK_ACTIVE))
|
if ((disk.state & (1 << MD_DISK_ACTIVE)) &&
|
||||||
&& disk.raid_disk < data_disks)
|
disk.raid_disk < data_disks)
|
||||||
/* keep this */
|
/* keep this */
|
||||||
continue;
|
continue;
|
||||||
ioctl(fd, HOT_REMOVE_DISK,
|
ioctl(fd, HOT_REMOVE_DISK,
|
||||||
|
@ -2921,8 +2921,8 @@ static int impose_level(int fd, int level, char *devname, int verbose)
|
||||||
if (disk.major == 0 && disk.minor == 0)
|
if (disk.major == 0 && disk.minor == 0)
|
||||||
continue;
|
continue;
|
||||||
found++;
|
found++;
|
||||||
if ((disk.state & (1 << MD_DISK_ACTIVE))
|
if ((disk.state & (1 << MD_DISK_ACTIVE)) &&
|
||||||
&& disk.raid_disk < data_disks)
|
disk.raid_disk < data_disks)
|
||||||
/* keep this */
|
/* keep this */
|
||||||
continue;
|
continue;
|
||||||
ioctl(fd, SET_DISK_FAULTY,
|
ioctl(fd, SET_DISK_FAULTY,
|
||||||
|
@ -3597,9 +3597,8 @@ started:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!st->ss->external &&
|
if (!st->ss->external &&
|
||||||
!(reshape.before.data_disks != reshape.after.data_disks
|
!(reshape.before.data_disks != reshape.after.data_disks &&
|
||||||
&& info->custom_array_size) &&
|
info->custom_array_size) && info->new_level == reshape.level &&
|
||||||
info->new_level == reshape.level &&
|
|
||||||
!forked) {
|
!forked) {
|
||||||
/* no need to wait for the reshape to finish as
|
/* no need to wait for the reshape to finish as
|
||||||
* there is nothing more to do.
|
* there is nothing more to do.
|
||||||
|
@ -4092,14 +4091,14 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape,
|
||||||
* before setting 'sync_action' to 'idle'.
|
* before setting 'sync_action' to 'idle'.
|
||||||
* So we need these extra tests.
|
* So we need these extra tests.
|
||||||
*/
|
*/
|
||||||
if (completed == 0 && advancing
|
if (completed == 0 && advancing &&
|
||||||
&& strncmp(action, "idle", 4) == 0
|
strncmp(action, "idle", 4) == 0 &&
|
||||||
&& info->reshape_progress > 0)
|
info->reshape_progress > 0)
|
||||||
break;
|
break;
|
||||||
if (completed == 0 && !advancing
|
if (completed == 0 && !advancing &&
|
||||||
&& strncmp(action, "idle", 4) == 0
|
strncmp(action, "idle", 4) == 0 &&
|
||||||
&& info->reshape_progress < (info->component_size
|
info->reshape_progress < (info->component_size
|
||||||
* reshape->after.data_disks))
|
* reshape->after.data_disks))
|
||||||
break;
|
break;
|
||||||
sysfs_wait(fd, NULL);
|
sysfs_wait(fd, NULL);
|
||||||
if (sysfs_fd_get_ll(fd, &completed) < 0)
|
if (sysfs_fd_get_ll(fd, &completed) < 0)
|
||||||
|
@ -4787,8 +4786,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt
|
||||||
/* reshape_progress is increasing */
|
/* reshape_progress is increasing */
|
||||||
if ((__le64_to_cpu(bsb.arraystart)
|
if ((__le64_to_cpu(bsb.arraystart)
|
||||||
+ __le64_to_cpu(bsb.length)
|
+ __le64_to_cpu(bsb.length)
|
||||||
< info->reshape_progress)
|
< info->reshape_progress) &&
|
||||||
&&
|
|
||||||
(__le64_to_cpu(bsb.arraystart2)
|
(__le64_to_cpu(bsb.arraystart2)
|
||||||
+ __le64_to_cpu(bsb.length2)
|
+ __le64_to_cpu(bsb.length2)
|
||||||
< info->reshape_progress))
|
< info->reshape_progress))
|
||||||
|
|
29
Manage.c
29
Manage.c
|
@ -204,11 +204,9 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry)
|
||||||
count = 5;
|
count = 5;
|
||||||
while (((fd = ((devname[0] == '/')
|
while (((fd = ((devname[0] == '/')
|
||||||
?open(devname, O_RDONLY|O_EXCL)
|
?open(devname, O_RDONLY|O_EXCL)
|
||||||
:open_dev_flags(devnm, O_RDONLY|O_EXCL))) < 0
|
:open_dev_flags(devnm, O_RDONLY|O_EXCL))) < 0 ||
|
||||||
|| strcmp(fd2devnm(fd), devnm) != 0)
|
strcmp(fd2devnm(fd), devnm) != 0) && container[0] &&
|
||||||
&& container[0]
|
mdmon_running(container) && count) {
|
||||||
&& mdmon_running(container)
|
|
||||||
&& count) {
|
|
||||||
/* Can't open, so something might be wrong. However it
|
/* Can't open, so something might be wrong. However it
|
||||||
* is a container, so we might be racing with mdmon, so
|
* is a container, so we might be racing with mdmon, so
|
||||||
* retry for a bit.
|
* retry for a bit.
|
||||||
|
@ -244,8 +242,8 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry)
|
||||||
while (count &&
|
while (count &&
|
||||||
(err = sysfs_set_str(mdi, NULL,
|
(err = sysfs_set_str(mdi, NULL,
|
||||||
"array_state",
|
"array_state",
|
||||||
"inactive")) < 0
|
"inactive")) < 0 &&
|
||||||
&& errno == EBUSY) {
|
errno == EBUSY) {
|
||||||
usleep(200000);
|
usleep(200000);
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
|
@ -447,9 +445,8 @@ done:
|
||||||
* so it is reasonable to retry for a while - 5 seconds.
|
* so it is reasonable to retry for a while - 5 seconds.
|
||||||
*/
|
*/
|
||||||
count = 25; err = 0;
|
count = 25; err = 0;
|
||||||
while (count && fd >= 0
|
while (count && fd >= 0 &&
|
||||||
&& (err = ioctl(fd, STOP_ARRAY, NULL)) < 0
|
(err = ioctl(fd, STOP_ARRAY, NULL)) < 0 && errno == EBUSY) {
|
||||||
&& errno == EBUSY) {
|
|
||||||
usleep(200000);
|
usleep(200000);
|
||||||
count --;
|
count --;
|
||||||
}
|
}
|
||||||
|
@ -795,8 +792,8 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FIXME this is a bad test to be using */
|
/* FIXME this is a bad test to be using */
|
||||||
if (!tst->sb && (dv->disposition != 'a'
|
if (!tst->sb && (dv->disposition != 'a' &&
|
||||||
&& dv->disposition != 'S')) {
|
dv->disposition != 'S')) {
|
||||||
/* we are re-adding a device to a
|
/* we are re-adding a device to a
|
||||||
* completely dead array - have to depend
|
* completely dead array - have to depend
|
||||||
* on kernel to check
|
* on kernel to check
|
||||||
|
@ -1393,8 +1390,7 @@ int Manage_subdevs(char *devname, int fd,
|
||||||
|
|
||||||
if (strcmp(dv->devname, "failed") == 0 ||
|
if (strcmp(dv->devname, "failed") == 0 ||
|
||||||
strcmp(dv->devname, "faulty") == 0) {
|
strcmp(dv->devname, "faulty") == 0) {
|
||||||
if (dv->disposition != 'A'
|
if (dv->disposition != 'A' && dv->disposition != 'r') {
|
||||||
&& dv->disposition != 'r') {
|
|
||||||
pr_err("%s only meaningful with -r or --re-add, not -%c\n",
|
pr_err("%s only meaningful with -r or --re-add, not -%c\n",
|
||||||
dv->devname, dv->disposition);
|
dv->devname, dv->disposition);
|
||||||
goto abort;
|
goto abort;
|
||||||
|
@ -1499,8 +1495,9 @@ int Manage_subdevs(char *devname, int fd,
|
||||||
goto abort;
|
goto abort;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ((dv->disposition == 'r' || dv->disposition == 'f')
|
} else if ((dv->disposition == 'r' ||
|
||||||
&& get_maj_min(dv->devname, &mj, &mn)) {
|
dv->disposition == 'f') &&
|
||||||
|
get_maj_min(dv->devname, &mj, &mn)) {
|
||||||
/* for 'fail' and 'remove', the device might
|
/* for 'fail' and 'remove', the device might
|
||||||
* not exist.
|
* not exist.
|
||||||
*/
|
*/
|
||||||
|
|
10
managemon.c
10
managemon.c
|
@ -499,9 +499,9 @@ static void manage_member(struct mdstat_ent *mdstat,
|
||||||
frozen = 1; /* can't read metadata_version assume the worst */
|
frozen = 1; /* can't read metadata_version assume the worst */
|
||||||
|
|
||||||
/* If sync_action is not 'idle' then don't try recovery now */
|
/* If sync_action is not 'idle' then don't try recovery now */
|
||||||
if (!frozen
|
if (!frozen &&
|
||||||
&& sysfs_get_str(&a->info, NULL, "sync_action", buf, sizeof(buf)) > 0
|
sysfs_get_str(&a->info, NULL, "sync_action",
|
||||||
&& strncmp(buf, "idle", 4) != 0)
|
buf, sizeof(buf)) > 0 && strncmp(buf, "idle", 4) != 0)
|
||||||
frozen = 1;
|
frozen = 1;
|
||||||
|
|
||||||
if (mdstat->level) {
|
if (mdstat->level) {
|
||||||
|
@ -626,8 +626,8 @@ static void manage_member(struct mdstat_ent *mdstat,
|
||||||
newd = xmalloc(sizeof(*newd));
|
newd = xmalloc(sizeof(*newd));
|
||||||
disk_init_and_add(newd, d, newa);
|
disk_init_and_add(newd, d, newa);
|
||||||
}
|
}
|
||||||
if (sysfs_get_ll(info, NULL, "array_size", &array_size) == 0
|
if (sysfs_get_ll(info, NULL, "array_size", &array_size) == 0 &&
|
||||||
&& a->info.custom_array_size > array_size*2) {
|
a->info.custom_array_size > array_size*2) {
|
||||||
sysfs_set_num(info, NULL, "array_size",
|
sysfs_set_num(info, NULL, "array_size",
|
||||||
a->info.custom_array_size/2);
|
a->info.custom_array_size/2);
|
||||||
}
|
}
|
||||||
|
|
3
mdadm.c
3
mdadm.c
|
@ -1843,8 +1843,7 @@ static int misc_scan(char devmode, struct context *c)
|
||||||
if (members != member)
|
if (members != member)
|
||||||
continue;
|
continue;
|
||||||
me = map_by_devnm(&map, e->devnm);
|
me = map_by_devnm(&map, e->devnm);
|
||||||
if (me && me->path
|
if (me && me->path && strcmp(me->path, "/unknown") != 0)
|
||||||
&& strcmp(me->path, "/unknown") != 0)
|
|
||||||
name = me->path;
|
name = me->path;
|
||||||
if (name == NULL || stat(name, &stb) != 0)
|
if (name == NULL || stat(name, &stb) != 0)
|
||||||
name = get_md_name(e->devnm);
|
name = get_md_name(e->devnm);
|
||||||
|
|
|
@ -576,8 +576,8 @@ static int read_and_act(struct active_array *a, fd_set *fds)
|
||||||
a->last_checkpoint = sync_completed;
|
a->last_checkpoint = sync_completed;
|
||||||
a->container->ss->set_array_state(a, a->curr_state <= clean);
|
a->container->ss->set_array_state(a, a->curr_state <= clean);
|
||||||
} else if ((a->curr_action == idle && a->prev_action == reshape) ||
|
} else if ((a->curr_action == idle && a->prev_action == reshape) ||
|
||||||
(a->curr_action == reshape
|
(a->curr_action == reshape &&
|
||||||
&& sync_completed > a->last_checkpoint) ) {
|
sync_completed > a->last_checkpoint)) {
|
||||||
/* Reshape has progressed or completed so we need to
|
/* Reshape has progressed or completed so we need to
|
||||||
* update the array state - and possibly the array size
|
* update the array state - and possibly the array size
|
||||||
*/
|
*/
|
||||||
|
|
33
super-ddf.c
33
super-ddf.c
|
@ -670,8 +670,8 @@ static int layout_md2ddf(const mdu_array_info_t *array,
|
||||||
sec_elmnt_count = array->raid_disks / 2;
|
sec_elmnt_count = array->raid_disks / 2;
|
||||||
srl = DDF_2SPANNED;
|
srl = DDF_2SPANNED;
|
||||||
prl = DDF_RAID1;
|
prl = DDF_RAID1;
|
||||||
} else if (array->raid_disks % 3 == 0
|
} else if (array->raid_disks % 3 == 0 &&
|
||||||
&& array->layout == 0x103) {
|
array->layout == 0x103) {
|
||||||
rlq = DDF_RAID1_MULTI;
|
rlq = DDF_RAID1_MULTI;
|
||||||
prim_elmnt_count = cpu_to_be16(3);
|
prim_elmnt_count = cpu_to_be16(3);
|
||||||
sec_elmnt_count = array->raid_disks / 3;
|
sec_elmnt_count = array->raid_disks / 3;
|
||||||
|
@ -853,8 +853,8 @@ static void *load_section(int fd, struct ddf_super *super, void *buf,
|
||||||
int dofree = (buf == NULL);
|
int dofree = (buf == NULL);
|
||||||
|
|
||||||
if (check)
|
if (check)
|
||||||
if (len != 2 && len != 8 && len != 32
|
if (len != 2 && len != 8 && len != 32 &&
|
||||||
&& len != 128 && len != 512)
|
len != 128 && len != 512)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (len > 1024)
|
if (len > 1024)
|
||||||
|
@ -2028,8 +2028,8 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info, char *m
|
||||||
be32_to_cpu(ddf->phys->entries[e].refnum) == 0xffffffff)
|
be32_to_cpu(ddf->phys->entries[e].refnum) == 0xffffffff)
|
||||||
e++;
|
e++;
|
||||||
if (i < info->array.raid_disks && e < max &&
|
if (i < info->array.raid_disks && e < max &&
|
||||||
!(be16_to_cpu(ddf->phys->entries[e].state)
|
!(be16_to_cpu(ddf->phys->entries[e].state) &
|
||||||
& DDF_Failed))
|
DDF_Failed))
|
||||||
map[i] = 1;
|
map[i] = 1;
|
||||||
else
|
else
|
||||||
map[i] = 0;
|
map[i] = 0;
|
||||||
|
@ -2114,11 +2114,10 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha
|
||||||
info->resync_start = 0;
|
info->resync_start = 0;
|
||||||
info->reshape_active = 0;
|
info->reshape_active = 0;
|
||||||
info->recovery_blocked = 0;
|
info->recovery_blocked = 0;
|
||||||
if (!(ddf->virt->entries[info->container_member].state
|
if (!(ddf->virt->entries[info->container_member].state &
|
||||||
& DDF_state_inconsistent) &&
|
DDF_state_inconsistent) &&
|
||||||
(ddf->virt->entries[info->container_member].init_state
|
(ddf->virt->entries[info->container_member].init_state &
|
||||||
& DDF_initstate_mask)
|
DDF_initstate_mask) == DDF_init_full)
|
||||||
== DDF_init_full)
|
|
||||||
info->resync_start = MaxSector;
|
info->resync_start = MaxSector;
|
||||||
|
|
||||||
uuid_from_super_ddf(st, info->uuid);
|
uuid_from_super_ddf(st, info->uuid);
|
||||||
|
@ -2135,7 +2134,7 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha
|
||||||
if (map)
|
if (map)
|
||||||
for (j = 0; j < map_disks; j++) {
|
for (j = 0; j < map_disks; j++) {
|
||||||
map[j] = 0;
|
map[j] = 0;
|
||||||
if (j < info->array.raid_disks) {
|
if (j < info->array.raid_disks) {
|
||||||
int i = find_phys(ddf, vc->conf.phys_refnum[j]);
|
int i = find_phys(ddf, vc->conf.phys_refnum[j]);
|
||||||
if (i >= 0 &&
|
if (i >= 0 &&
|
||||||
(be16_to_cpu(ddf->phys->entries[i].state)
|
(be16_to_cpu(ddf->phys->entries[i].state)
|
||||||
|
@ -4618,9 +4617,9 @@ static void ddf_remove_failed(struct ddf_super *ddf)
|
||||||
0xFFFFFFFF)
|
0xFFFFFFFF)
|
||||||
continue;
|
continue;
|
||||||
if (be16_and(ddf->phys->entries[pdnum].state,
|
if (be16_and(ddf->phys->entries[pdnum].state,
|
||||||
cpu_to_be16(DDF_Failed))
|
cpu_to_be16(DDF_Failed)) &&
|
||||||
&& be16_and(ddf->phys->entries[pdnum].state,
|
be16_and(ddf->phys->entries[pdnum].state,
|
||||||
cpu_to_be16(DDF_Transition))) {
|
cpu_to_be16(DDF_Transition))) {
|
||||||
/* skip this one unless in dlist*/
|
/* skip this one unless in dlist*/
|
||||||
for (dl = ddf->dlist; dl; dl = dl->next)
|
for (dl = ddf->dlist; dl; dl = dl->next)
|
||||||
if (dl->pdnum == (int)pdnum)
|
if (dl->pdnum == (int)pdnum)
|
||||||
|
@ -5151,8 +5150,8 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a,
|
||||||
vc = (struct vd_config *)(mu->buf
|
vc = (struct vd_config *)(mu->buf
|
||||||
+ i_sec * ddf->conf_rec_len * 512);
|
+ i_sec * ddf->conf_rec_len * 512);
|
||||||
for (dl = ddf->dlist; dl; dl = dl->next)
|
for (dl = ddf->dlist; dl; dl = dl->next)
|
||||||
if (dl->major == di->disk.major
|
if (dl->major == di->disk.major &&
|
||||||
&& dl->minor == di->disk.minor)
|
dl->minor == di->disk.minor)
|
||||||
break;
|
break;
|
||||||
if (!dl || dl->pdnum < 0) {
|
if (!dl || dl->pdnum < 0) {
|
||||||
pr_err("BUG: can't find disk %d (%d/%d)\n",
|
pr_err("BUG: can't find disk %d (%d/%d)\n",
|
||||||
|
|
|
@ -4165,8 +4165,8 @@ int check_mpb_migr_compatibility(struct intel_super *super)
|
||||||
if (pba_of_lba0(map0) != pba_of_lba0(map1))
|
if (pba_of_lba0(map0) != pba_of_lba0(map1))
|
||||||
/* migration optimization area was used */
|
/* migration optimization area was used */
|
||||||
return -1;
|
return -1;
|
||||||
if (migr_rec->ascending_migr == 0
|
if (migr_rec->ascending_migr == 0 &&
|
||||||
&& migr_rec->dest_depth_per_unit > 0)
|
migr_rec->dest_depth_per_unit > 0)
|
||||||
/* descending reshape not supported yet */
|
/* descending reshape not supported yet */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -6442,7 +6442,7 @@ active_arrays_by_format(char *name, char* hba, struct md_list **devlist,
|
||||||
|
|
||||||
for (memb = mdstat ; memb ; memb = memb->next) {
|
for (memb = mdstat ; memb ; memb = memb->next) {
|
||||||
if (memb->metadata_version &&
|
if (memb->metadata_version &&
|
||||||
(strncmp(memb->metadata_version, "external:", 9) == 0) &&
|
(strncmp(memb->metadata_version, "external:", 9) == 0) &&
|
||||||
(strcmp(&memb->metadata_version[9], name) == 0) &&
|
(strcmp(&memb->metadata_version[9], name) == 0) &&
|
||||||
!is_subarray(memb->metadata_version+9) &&
|
!is_subarray(memb->metadata_version+9) &&
|
||||||
memb->members) {
|
memb->members) {
|
||||||
|
@ -11640,8 +11640,8 @@ static int imsm_manage_reshape(
|
||||||
|
|
||||||
/* Find volume during the reshape */
|
/* Find volume during the reshape */
|
||||||
for (dv = super->devlist; dv; dv = dv->next) {
|
for (dv = super->devlist; dv; dv = dv->next) {
|
||||||
if (dv->dev->vol.migr_type == MIGR_GEN_MIGR
|
if (dv->dev->vol.migr_type == MIGR_GEN_MIGR &&
|
||||||
&& dv->dev->vol.migr_state == 1) {
|
dv->dev->vol.migr_state == 1) {
|
||||||
dev = dv->dev;
|
dev = dv->dev;
|
||||||
migr_vol_qan++;
|
migr_vol_qan++;
|
||||||
}
|
}
|
||||||
|
|
20
util.c
20
util.c
|
@ -1014,21 +1014,18 @@ char *get_md_name(char *devnm)
|
||||||
if (strncmp(devnm, "md_", 3) == 0) {
|
if (strncmp(devnm, "md_", 3) == 0) {
|
||||||
snprintf(devname, sizeof(devname), "/dev/md/%s",
|
snprintf(devname, sizeof(devname), "/dev/md/%s",
|
||||||
devnm + 3);
|
devnm + 3);
|
||||||
if (stat(devname, &stb) == 0
|
if (stat(devname, &stb) == 0 &&
|
||||||
&& (S_IFMT&stb.st_mode) == S_IFBLK
|
(S_IFMT&stb.st_mode) == S_IFBLK && (stb.st_rdev == rdev))
|
||||||
&& (stb.st_rdev == rdev))
|
|
||||||
return devname;
|
return devname;
|
||||||
}
|
}
|
||||||
snprintf(devname, sizeof(devname), "/dev/%s", devnm);
|
snprintf(devname, sizeof(devname), "/dev/%s", devnm);
|
||||||
if (stat(devname, &stb) == 0
|
if (stat(devname, &stb) == 0 && (S_IFMT&stb.st_mode) == S_IFBLK &&
|
||||||
&& (S_IFMT&stb.st_mode) == S_IFBLK
|
(stb.st_rdev == rdev))
|
||||||
&& (stb.st_rdev == rdev))
|
|
||||||
return devname;
|
return devname;
|
||||||
|
|
||||||
snprintf(devname, sizeof(devname), "/dev/md/%s", devnm+2);
|
snprintf(devname, sizeof(devname), "/dev/md/%s", devnm+2);
|
||||||
if (stat(devname, &stb) == 0
|
if (stat(devname, &stb) == 0 && (S_IFMT&stb.st_mode) == S_IFBLK &&
|
||||||
&& (S_IFMT&stb.st_mode) == S_IFBLK
|
(stb.st_rdev == rdev))
|
||||||
&& (stb.st_rdev == rdev))
|
|
||||||
return devname;
|
return devname;
|
||||||
|
|
||||||
dn = map_dev(major(rdev), minor(rdev), 0);
|
dn = map_dev(major(rdev), minor(rdev), 0);
|
||||||
|
@ -1039,9 +1036,8 @@ char *get_md_name(char *devnm)
|
||||||
if (errno != EEXIST)
|
if (errno != EEXIST)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (stat(devname, &stb) == 0
|
if (stat(devname, &stb) == 0 && (S_IFMT&stb.st_mode) == S_IFBLK &&
|
||||||
&& (S_IFMT&stb.st_mode) == S_IFBLK
|
(stb.st_rdev == rdev))
|
||||||
&& (stb.st_rdev == rdev))
|
|
||||||
return devname;
|
return devname;
|
||||||
unlink(devname);
|
unlink(devname);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue