mdadm: Fixup != broken formatting

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Jes Sorensen 2017-05-16 14:09:57 -04:00
parent b831b299e8
commit d16a749444
6 changed files with 24 additions and 22 deletions

View File

@ -755,8 +755,8 @@ static int load_devices(struct devs *devices, char *devmap,
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.

13
Grow.c
View File

@ -1403,8 +1403,8 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
if (info->new_layout == UnSet) { if (info->new_layout == UnSet) {
int copies = 1 + (info->delta_disks int copies = 1 + (info->delta_disks
/ info->array.raid_disks); / info->array.raid_disks);
if (info->array.raid_disks * (copies-1) if (info->array.raid_disks * (copies-1) !=
!= info->delta_disks) info->delta_disks)
return "Impossible number of devices for RAID0->RAID10"; return "Impossible number of devices for RAID0->RAID10";
info->new_layout = 0x100 + copies; info->new_layout = 0x100 + copies;
} }
@ -3067,8 +3067,8 @@ static int reshape_array(char *container, int fd, char *devname,
if (restart && if (restart &&
(reshape.level != info->array.level || (reshape.level != info->array.level ||
reshape.before.layout != info->array.layout || reshape.before.layout != info->array.layout ||
reshape.before.data_disks + reshape.parity reshape.before.data_disks + reshape.parity !=
!= info->array.raid_disks - max(0, info->delta_disks))) { info->array.raid_disks - max(0, info->delta_disks))) {
pr_err("reshape info is not in native format - cannot continue.\n"); pr_err("reshape info is not in native format - cannot continue.\n");
goto release; goto release;
} }
@ -4281,8 +4281,9 @@ static int grow_backup(struct mdinfo *sra,
((char*)&bsb.sb_csum2)-((char*)&bsb)); ((char*)&bsb.sb_csum2)-((char*)&bsb));
rv = -1; rv = -1;
if ((unsigned long long)lseek64(destfd[i], destoffsets[i] - 4096, 0) if ((unsigned long long)lseek64(destfd[i],
!= destoffsets[i] - 4096) destoffsets[i] - 4096, 0) !=
destoffsets[i] - 4096)
break; break;
if (write(destfd[i], &bsb, 512) != 512) if (write(destfd[i], &bsb, 512) != 512)
break; break;

View File

@ -887,9 +887,8 @@ int Write_rules(char *rule_name)
fd = 1; fd = 1;
/* write static invocation */ /* write static invocation */
if (write(fd, udev_template_start, if (write(fd, udev_template_start, sizeof(udev_template_start) - 1) !=
sizeof(udev_template_start) - 1) (int)sizeof(udev_template_start) - 1)
!= (int)sizeof(udev_template_start)-1)
goto abort; goto abort;
/* iterate, if none created or error occurred, remove file */ /* iterate, if none created or error occurred, remove file */

View File

@ -581,14 +581,16 @@ int save_stripes(int *source, unsigned long long *offsets,
raid_disks, level, layout); raid_disks, level, layout);
if (dnum < 0) abort(); if (dnum < 0) abort();
if (source[dnum] < 0 || if (source[dnum] < 0 ||
lseek64(source[dnum], offsets[dnum]+offset, 0) < 0 || lseek64(source[dnum],
read(source[dnum], buf+disk * chunk_size, chunk_size) offsets[dnum] + offset, 0) < 0 ||
!= chunk_size) read(source[dnum], buf+disk * chunk_size,
chunk_size) != chunk_size) {
if (failed <= 2) { if (failed <= 2) {
fdisk[failed] = dnum; fdisk[failed] = dnum;
fblock[failed] = disk; fblock[failed] = disk;
failed++; failed++;
} }
}
} }
if (failed == 0 || fblock[0] >= data_disks) if (failed == 0 || fblock[0] >= data_disks)
/* all data disks are good */ /* all data disks are good */

View File

@ -3511,8 +3511,8 @@ static int validate_geometry_ddf_bvd(struct supertype *st,
if (minsize == 0) if (minsize == 0)
minsize = 8; minsize = 8;
for (dl = ddf->dlist; dl ; dl = dl->next) { for (dl = ddf->dlist; dl ; dl = dl->next) {
if (find_space(ddf, dl, data_offset, &minsize) if (find_space(ddf, dl, data_offset, &minsize) !=
!= INVALID_SECTORS) INVALID_SECTORS)
dcnt++; dcnt++;
} }
if (dcnt < raiddisks) { if (dcnt < raiddisks) {
@ -4004,8 +4004,8 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst)
continue; continue;
if (posix_memalign((void **)&dl1, 512, if (posix_memalign((void **)&dl1, 512,
sizeof(*dl1) + (first->max_part) * sizeof(dl1->vlist[0])) sizeof(*dl1) + (first->max_part) *
!= 0) { sizeof(dl1->vlist[0])) != 0) {
pr_err("could not allocate disk info buffer\n"); pr_err("could not allocate disk info buffer\n");
return 3; return 3;
} }

View File

@ -589,8 +589,8 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
* being marked 'sync' * being marked 'sync'
*/ */
add = (1<<MD_DISK_SYNC); add = (1<<MD_DISK_SYNC);
if (((sb->disks[d].state & ~mask) | add) if (((sb->disks[d].state & ~mask) | add) !=
!= (unsigned)info->disk.state) { (unsigned)info->disk.state) {
sb->disks[d].state = info->disk.state | wonly |failfast; sb->disks[d].state = info->disk.state | wonly |failfast;
rv = 1; rv = 1;
} }
@ -1058,8 +1058,8 @@ static int load_super0(struct supertype *st, int fd, char *devname)
* valid. If it doesn't clear the bit. An --assemble --force * valid. If it doesn't clear the bit. An --assemble --force
* should get that written out. * should get that written out.
*/ */
if (read(fd, super+1, ROUND_UP(sizeof(struct bitmap_super_s),4096)) if (read(fd, super+1, ROUND_UP(sizeof(struct bitmap_super_s),4096)) !=
!= ROUND_UP(sizeof(struct bitmap_super_s),4096)) ROUND_UP(sizeof(struct bitmap_super_s), 4096))
goto no_bitmap; goto no_bitmap;
uuid_from_super0(st, uuid); uuid_from_super0(st, uuid);