summaryrefslogtreecommitdiff
path: root/Incremental.c
diff options
context:
space:
mode:
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/Incremental.c b/Incremental.c
index 24fd8276..0f507bb3 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -644,8 +644,7 @@ out:
close(mdfd);
if (policy)
dev_policy_free(policy);
- if (sra)
- sysfs_free(sra);
+ sysfs_free(sra);
return rv;
out_unlock:
map_unlock(&map);
@@ -989,8 +988,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
sizeof(target->uuid)) == 0 &&
sra->array.failed_disks > 0) {
/* This is our target!! */
- if (chosen)
- sysfs_free(chosen);
+ sysfs_free(chosen);
chosen = sra;
sra = NULL;
/* skip to end so we don't check any more */
@@ -1022,8 +1020,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
sra = NULL;
}
next:
- if (sra)
- sysfs_free(sra);
+ sysfs_free(sra);
if (st != st2)
free(st2);
if (dl)
@@ -1037,7 +1034,8 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
char chosen_devname[24]; // 2*11 for int (including signs) + colon + null
devlist.next = NULL;
devlist.used = 0;
- devlist.writemostly = 0;
+ devlist.writemostly = FlagDefault;
+ devlist.failfast = FlagDefault;
devlist.devname = chosen_devname;
sprintf(chosen_devname, "%d:%d", major(stb.st_rdev),
minor(stb.st_rdev));
@@ -1350,8 +1348,12 @@ restart:
if (devnm && strcmp(devnm, me->devnm) != 0)
continue;
- if (devnm && me->metadata[0] == '/') {
+ if (me->metadata[0] == '/') {
char *sl;
+
+ if (!devnm)
+ continue;
+
/* member array, need to work on container */
strncpy(container, me->metadata+1, 32);
container[31] = 0;