850cf2857b
- SLE15 continues to use mdadm-4.0, synchronize mdadm package from SLE12-SP3 to SLE15, re-order all patches. - Rename the following patches, they are deleted and re-add in next part of patches 0001-Generic-support-for-consistency-policy-and-PPL.patch 0002-Detail-show-consistency-policy.patch 0002-The-mdcheck-script-now-adds-messages-to-the-system.patch 0003-imsm-PPL-support.patch 0004-super1-PPL-support.patch 0005-Add-ppl-and-no-ppl-options-for-update.patch 0006-Grow-support-consistency-policy-change.patch 0007-udev-md-raid-assembly.rules-Skip-non-ready-devices.patch 0008-Retry-HOT_REMOVE_DISK-a-few-times.patch 0009-Introduce-sys_hot_remove_disk.patch 0010-Add-force-flag-to-hot_remove_disk.patch 0011-Detail-handle-non-existent-arrays-better.patch - Synchronize patches from mdadm of SLE12-SP3, the above renamed patches are re-add here, 0001-Makefile-Fix-date-to-be-output-in-ISO-format.patch 0002-imsm-fix-missing-error-message-during-migration.patch 0003-Fix-oddity-where-mdadm-did-not-recognise-a-relative-.patch 0004-mdadm-check-the-nodes-when-operate-clustered-array.patch 0005-examine-tidy-up-some-code.patch 0006-mdadm-add-man-page-for-symlinks.patch 0007-mdadm-add-checking-clustered-bitmap-in-assemble-mode.patch 0008-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch 0009-mdadm-Specify-enough-length-when-write-to-buffer.patch 0010-mdadm-it-doesn-t-make-sense-to-set-bitmap-twice.patch 0011-mdadm-Monitor-Fix-NULL-pointer-dereference-when-stat.patch 0012-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch OBS-URL: https://build.opensuse.org/request/show/517978 OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=150
165 lines
5.4 KiB
Diff
165 lines
5.4 KiB
Diff
From 98dbf73cba81cd846f9c706f37edc22e21038cf4 Mon Sep 17 00:00:00 2001
|
|
From: Jes Sorensen <Jes.Sorensen@gmail.com>
|
|
Date: Wed, 5 Apr 2017 11:57:30 -0400
|
|
Subject: [PATCH] Create: Fixup various whitespace issues
|
|
|
|
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
|
|
---
|
|
Create.c | 50 ++++++++++++++++++++++++--------------------------
|
|
1 file changed, 24 insertions(+), 26 deletions(-)
|
|
|
|
Index: mdadm/Create.c
|
|
===================================================================
|
|
--- mdadm.orig/Create.c
|
|
+++ mdadm/Create.c
|
|
@@ -84,12 +84,12 @@ int Create(struct supertype *st, char *m
|
|
* RUN_ARRAY
|
|
*/
|
|
int mdfd;
|
|
- unsigned long long minsize=0, maxsize=0;
|
|
+ unsigned long long minsize = 0, maxsize = 0;
|
|
char *mindisc = NULL;
|
|
char *maxdisc = NULL;
|
|
int dnum, raid_disk_num;
|
|
struct mddev_dev *dv;
|
|
- int fail=0, warn=0;
|
|
+ int fail = 0, warn = 0;
|
|
struct stat stb;
|
|
int first_missing = subdevs * 2;
|
|
int second_missing = subdevs * 2;
|
|
@@ -260,7 +260,7 @@ int Create(struct supertype *st, char *m
|
|
&s->chunk, s->size*2,
|
|
data_offset, NULL,
|
|
&newsize, s->consistency_policy,
|
|
- c->verbose>=0))
|
|
+ c->verbose >= 0))
|
|
return 1;
|
|
|
|
if (s->chunk && s->chunk != UnSet) {
|
|
@@ -291,7 +291,7 @@ int Create(struct supertype *st, char *m
|
|
info.array.active_disks = 0;
|
|
info.array.working_disks = 0;
|
|
dnum = 0;
|
|
- for (dv = devlist; dv ; dv = dv->next)
|
|
+ for (dv = devlist; dv; dv = dv->next)
|
|
if (data_offset == VARIABLE_OFFSET)
|
|
dv->data_offset = INVALID_SECTORS;
|
|
else
|
|
@@ -303,7 +303,7 @@ int Create(struct supertype *st, char *m
|
|
int dfd;
|
|
char *doff;
|
|
|
|
- if (strcasecmp(dname, "missing")==0) {
|
|
+ if (strcasecmp(dname, "missing") == 0) {
|
|
if (first_missing > dnum)
|
|
first_missing = dnum;
|
|
if (second_missing > dnum && dnum > first_missing)
|
|
@@ -349,7 +349,7 @@ int Create(struct supertype *st, char *m
|
|
*/
|
|
int i;
|
|
char *name = "default";
|
|
- for(i=0; !st && superlist[i]; i++) {
|
|
+ for(i = 0; !st && superlist[i]; i++) {
|
|
st = superlist[i]->match_metadata_desc(name);
|
|
if (!st)
|
|
continue;
|
|
@@ -445,10 +445,10 @@ int Create(struct supertype *st, char *m
|
|
skip_size_check:
|
|
if (c->runstop != 1 || c->verbose >= 0) {
|
|
int fd = open(dname, O_RDONLY);
|
|
- if (fd <0 ) {
|
|
+ if (fd < 0) {
|
|
pr_err("Cannot open %s: %s\n",
|
|
dname, strerror(errno));
|
|
- fail=1;
|
|
+ fail = 1;
|
|
continue;
|
|
}
|
|
warn |= check_ext2(fd, dname);
|
|
@@ -497,7 +497,7 @@ int Create(struct supertype *st, char *m
|
|
return 1;
|
|
}
|
|
if (s->level > 0 || s->level == LEVEL_MULTIPATH ||
|
|
- s->level == LEVEL_FAULTY || st->ss->external ) {
|
|
+ s->level == LEVEL_FAULTY || st->ss->external) {
|
|
/* size is meaningful */
|
|
if (!st->ss->validate_geometry(st, s->level, s->layout,
|
|
s->raiddisks,
|
|
@@ -572,9 +572,9 @@ int Create(struct supertype *st, char *m
|
|
* as missing, so that a reconstruct happens (faster than re-parity)
|
|
* FIX: Can we do this for raid6 as well?
|
|
*/
|
|
- if (st->ss->external == 0 &&
|
|
- s->assume_clean==0 && c->force == 0 && first_missing >= s->raiddisks) {
|
|
- switch ( s->level ) {
|
|
+ if (st->ss->external == 0 && s->assume_clean == 0 &&
|
|
+ c->force == 0 && first_missing >= s->raiddisks) {
|
|
+ switch (s->level) {
|
|
case 4:
|
|
case 5:
|
|
insert_point = s->raiddisks-1;
|
|
@@ -649,7 +649,7 @@ int Create(struct supertype *st, char *m
|
|
* with, but it chooses to trust me instead. Sigh
|
|
*/
|
|
info.array.md_minor = 0;
|
|
- if (fstat(mdfd, &stb)==0)
|
|
+ if (fstat(mdfd, &stb) == 0)
|
|
info.array.md_minor = minor(stb.st_rdev);
|
|
info.array.not_persistent = 0;
|
|
|
|
@@ -715,13 +715,11 @@ int Create(struct supertype *st, char *m
|
|
name = strrchr(mddev, '/');
|
|
if (name) {
|
|
name++;
|
|
- if (strncmp(name, "md_", 3)==0 &&
|
|
- strlen(name) > 3 &&
|
|
- (name-mddev) == 5 /* /dev/ */)
|
|
+ if (strncmp(name, "md_", 3) == 0 &&
|
|
+ strlen(name) > 3 && (name-mddev) == 5 /* /dev/ */)
|
|
name += 3;
|
|
- else if (strncmp(name, "md", 2)==0 &&
|
|
- strlen(name) > 2 &&
|
|
- isdigit(name[2]) &&
|
|
+ else if (strncmp(name, "md", 2) == 0 &&
|
|
+ strlen(name) > 2 && isdigit(name[2]) &&
|
|
(name-mddev) == 5 /* /dev/ */)
|
|
name += 2;
|
|
}
|
|
@@ -769,9 +767,9 @@ int Create(struct supertype *st, char *m
|
|
#endif
|
|
}
|
|
|
|
- if (s->bitmap_file && (strcmp(s->bitmap_file, "internal")==0 ||
|
|
- strcmp(s->bitmap_file, "clustered")==0)) {
|
|
- if ((vers%100) < 2) {
|
|
+ if (s->bitmap_file && (strcmp(s->bitmap_file, "internal") == 0 ||
|
|
+ strcmp(s->bitmap_file, "clustered") == 0)) {
|
|
+ if ((vers % 100) < 2) {
|
|
pr_err("internal bitmaps not supported by this kernel.\n");
|
|
goto abort_locked;
|
|
}
|
|
@@ -851,11 +849,11 @@ int Create(struct supertype *st, char *m
|
|
|
|
infos = xmalloc(sizeof(*infos) * total_slots);
|
|
enable_fds(total_slots);
|
|
- for (pass=1; pass <=2 ; pass++) {
|
|
+ for (pass = 1; pass <= 2; pass++) {
|
|
struct mddev_dev *moved_disk = NULL; /* the disk that was moved out of the insert point */
|
|
|
|
- for (dnum=0, raid_disk_num=0, dv = devlist ; dv ;
|
|
- dv=(dv->next)?(dv->next):moved_disk, dnum++) {
|
|
+ for (dnum = 0, raid_disk_num = 0, dv = devlist; dv;
|
|
+ dv = (dv->next) ? (dv->next) : moved_disk, dnum++) {
|
|
int fd;
|
|
struct stat stb;
|
|
struct mdinfo *inf = &infos[dnum];
|
|
@@ -867,7 +865,7 @@ int Create(struct supertype *st, char *m
|
|
moved_disk = dv;
|
|
continue;
|
|
}
|
|
- if (strcasecmp(dv->devname, "missing")==0) {
|
|
+ if (strcasecmp(dv->devname, "missing") == 0) {
|
|
raid_disk_num += 1;
|
|
continue;
|
|
}
|