mdadm/forced-type-conversion-to-avoid-truncation.patch
Xiao Ni bf6fddd70e Fix building errors against newer gcc(>=7.0)
Resolves: bz#144756

Signed-off-by: Xiao Ni <xni@redhat.com>
2017-04-26 13:15:35 +08:00

28 lines
997 B
Diff

commit 5b97512954e9710fd45ab5778bf679205c35892d
Author: Xiao Ni <xni@redhat.com>
Date: Sat Mar 18 10:33:45 2017 +0800
mdadm: Forced type conversion to avoid truncation
Gcc reports it needs 19 bytes to right to disk->serial. Because the
type of argument i is int. But the meaning of i is failed disk
number. So it doesn't need to use 19 bytes. Just add a type
conversion to avoid this building error
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
diff --git a/super-intel.c b/super-intel.c
index 343f20d..e1618f1 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5228,7 +5228,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
disk->status = CONFIGURED_DISK | FAILED_DISK;
disk->scsi_id = __cpu_to_le32(~(__u32)0);
snprintf((char *) disk->serial, MAX_RAID_SERIAL_LEN,
- "missing:%d", i);
+ "missing:%d", (__u8)i);
}
find_missing(super);
} else {