summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch')
-rw-r--r--meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch75
1 files changed, 35 insertions, 40 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
index f7c55142f6..267c007c21 100644
--- a/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
+++ b/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
@@ -1,50 +1,45 @@
1From f3acf8499a4cc400206c5c56f0a6c69192ed55de Mon Sep 17 00:00:00 2001 1From c65898b9da82df94e1bae7937e415a7eb80355d5 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com> 2From: "Maxin B. John" <maxin.john@intel.com>
3Date: Sat, 7 Nov 2015 04:21:17 -0500 3Date: Wed, 10 Feb 2016 17:28:05 +0200
4Subject: [PATCH] mdadm: fix ptest build errors 4Subject: [PATCH] mdadm-fix-ptest-build-errors
5 5
6Check return value for posix_memalign() to fix ptest build error: 6builds fail with ptest enabled:
7 7
8 raid6check.c:352:2: error: ignoring return value of posix_memalign, \ 8| restripe.c: In function 'test_stripes':
9 declared with attribute warn_unused_result [-Werror=unused-result] 9| restripe.c:845:4: error: ignoring return value of 'read', declared with
10 10| attribute warn_unused_result [-Werror=unused-result]
11Initialize *stripe_buf as NULL to fix ptest build error: 11| read(source[i], stripes[i], chunk_size);
12 12| ^
13 raid6check.c: In function 'check_stripes': 13| cc1: all warnings being treated as errors
14 raid6check.c:315:8: error: 'stripe_buf' may be used uninitialized \ 14| Makefile:214: recipe for target 'test_stripe' failed
15 in this function [-Werror=maybe-uninitialized]
16 15
17Upstream-Status: Pending 16Upstream-Status: Pending
18 17
19Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> 18Signed-off-by: Maxin B. John <maxin.john@intel.com>
20--- 19---
21 raid6check.c | 6 ++++-- 20 restripe.c | 6 +++++-
22 1 file changed, 4 insertions(+), 2 deletions(-) 21 1 file changed, 5 insertions(+), 1 deletion(-)
23 22
24diff --git a/raid6check.c b/raid6check.c 23diff --git a/restripe.c b/restripe.c
25index cb8522e..9462bcf 100644 24index 56dca73..d24b2b4 100644
26--- a/raid6check.c 25--- a/restripe.c
27+++ b/raid6check.c 26+++ b/restripe.c
28@@ -312,7 +312,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, 27@@ -842,10 +842,14 @@ int test_stripes(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 28
35 /* stripes[] is indexed by raid_disk and holds chunks from each device */ 29 while (length > 0) {
36 char **stripes = xmalloc(raid_disks * sizeof(char*)); 30 int disk;
37@@ -349,7 +349,9 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, 31+ ssize_t ret;
38 if (!tables_ready)
39 make_tables();
40 32
41- posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size); 33 for (i = 0 ; i < raid_disks ; i++) {
42+ if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size) != 0) 34 lseek64(source[i], offsets[i]+start, 0);
43+ goto exitCheck; 35- read(source[i], stripes[i], chunk_size);
44+ 36+ ret = read(source[i], stripes[i], chunk_size);
45 block_index_for_slot += 2; 37+ if (ret == -1) {
46 blocks += 2; 38+ printf("Read Failed\n");
47 blocks_page += 2; 39+ }
40 }
41 for (i = 0 ; i < data_disks ; i++) {
42 int disk = geo_map(i, start/chunk_size, raid_disks,
48-- 43--
491.9.1 442.4.0
50 45