summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/mdadm/files
diff options
context:
space:
mode:
authorWenzong Fan <wenzong.fan@windriver.com>2015-10-15 23:24:14 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-25 08:08:09 +0000
commit82107b120947171293d8aed839c2144139951828 (patch)
tree1a12375c38579f59397c6cabbe5d9bcf31d47c97 /meta/recipes-extended/mdadm/files
parentd8adfd28f71136e67fffbf79c32384a81ef29676 (diff)
downloadpoky-82107b120947171293d8aed839c2144139951828.tar.gz
mdadm: fix CFLAGS and ptest issues
* Pass global CFLAGS to build: The CFLAGS does not pass to build at all since it was redefined by mdadm Makefile: CFLAGS = $(CWFLAGS) $(CXFLAGS) ... This could be done by setting 'CXFLAGS="${CFLAGS}"'. * Also fix ptest build errors caused by global CFLAGS: raid6check.c:352:2: error: ignoring return value of posix_memalign, \ declared with attribute warn_unused_result [-Werror=unused-result] raid6check.c:315:8: error: 'stripe_buf' may be used uninitialized \ in this function [-Werror=maybe-uninitialized] (From OE-Core rev: 60f71fa4da86ca4c7c37115c343db194a3b7b47b) Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/mdadm/files')
-rw-r--r--meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
new file mode 100644
index 0000000000..f7c55142f6
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
@@ -0,0 +1,50 @@
1From f3acf8499a4cc400206c5c56f0a6c69192ed55de Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Sat, 7 Nov 2015 04:21:17 -0500
4Subject: [PATCH] mdadm: fix ptest build errors
5
6Check return value for posix_memalign() to fix ptest build error:
7
8 raid6check.c:352:2: error: ignoring return value of posix_memalign, \
9 declared with attribute warn_unused_result [-Werror=unused-result]
10
11Initialize *stripe_buf as NULL to fix ptest build error:
12
13 raid6check.c: In function 'check_stripes':
14 raid6check.c:315:8: error: 'stripe_buf' may be used uninitialized \
15 in this function [-Werror=maybe-uninitialized]
16
17Upstream-Status: Pending
18
19Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
20---
21 raid6check.c | 6 ++++--
22 1 file changed, 4 insertions(+), 2 deletions(-)
23
24diff --git a/raid6check.c b/raid6check.c
25index cb8522e..9462bcf 100644
26--- a/raid6check.c
27+++ b/raid6check.c
28@@ -312,7 +312,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets,
29 /* read the data and p and q blocks, and check we got them right */
30 int data_disks = raid_disks - 2;
31 int syndrome_disks = data_disks + is_ddf(layout) * 2;
32- char *stripe_buf;
33+ char *stripe_buf = NULL;
34
35 /* stripes[] is indexed by raid_disk and holds chunks from each device */
36 char **stripes = xmalloc(raid_disks * sizeof(char*));
37@@ -349,7 +349,9 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets,
38 if (!tables_ready)
39 make_tables();
40
41- posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size);
42+ if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size) != 0)
43+ goto exitCheck;
44+
45 block_index_for_slot += 2;
46 blocks += 2;
47 blocks_page += 2;
48--
491.9.1
50