blob: 94fde42e9926b1f7b25163cbfb3b0d690f34860d [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 5da889032e2d99751ed9fe60016146e9ae8114cd Mon Sep 17 00:00:00 2001
2From: Xiao Ni <xni@redhat.com>
3Date: Sat, 18 Mar 2017 10:33:45 +0800
4Subject: [PATCH 4/5] mdadm: Forced type conversion to avoid truncation
5
6Gcc reports it needs 19 bytes to right to disk->serial. Because the
7type of argument i is int. But the meaning of i is failed disk
8number. So it doesn't need to use 19 bytes. Just add a type
9conversion to avoid this building error
10
11Signed-off-by: Xiao Ni <xni@redhat.com>
12Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
13---
14Upstream-Status: Backport
15 super-intel.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/super-intel.c b/super-intel.c
19index 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--
322.12.2
33