Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 5da889032e2d99751ed9fe60016146e9ae8114cd Mon Sep 17 00:00:00 2001 |
| 2 | From: Xiao Ni <xni@redhat.com> |
| 3 | Date: Sat, 18 Mar 2017 10:33:45 +0800 |
| 4 | Subject: [PATCH 4/5] mdadm: Forced type conversion to avoid truncation |
| 5 | |
| 6 | Gcc reports it needs 19 bytes to right to disk->serial. Because the |
| 7 | type of argument i is int. But the meaning of i is failed disk |
| 8 | number. So it doesn't need to use 19 bytes. Just add a type |
| 9 | conversion to avoid this building error |
| 10 | |
| 11 | Signed-off-by: Xiao Ni <xni@redhat.com> |
| 12 | Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com> |
| 13 | --- |
| 14 | Upstream-Status: Backport |
| 15 | super-intel.c | 2 +- |
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/super-intel.c b/super-intel.c |
| 19 | index 5499098..4e466ff 100644 |
| 20 | --- a/super-intel.c |
| 21 | +++ b/super-intel.c |
| 22 | @@ -5228,7 +5228,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, |
| 23 | disk->status = CONFIGURED_DISK | FAILED_DISK; |
| 24 | disk->scsi_id = __cpu_to_le32(~(__u32)0); |
| 25 | snprintf((char *) disk->serial, MAX_RAID_SERIAL_LEN, |
| 26 | - "missing:%d", i); |
| 27 | + "missing:%d", (__u8)i); |
| 28 | } |
| 29 | find_missing(super); |
| 30 | } else { |
| 31 | -- |
| 32 | 2.12.2 |
| 33 | |