diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2017-05-12 12:32:07 +0100 |
---|---|---|
committer | Dimitri John Ledkov <xnox@ubuntu.com> | 2017-05-12 12:32:07 +0100 |
commit | 77b19ed5f259bc62680acf2b1a3454baa2472bc5 (patch) | |
tree | 7441d8d057c09e54c8ea23c984f2ccdf22c98649 /Incremental.c | |
parent | ca114f3c76374493f0fd64f8ea0a9b96ae9b1dc5 (diff) |
New upstream release.
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 18 |
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; |