blob: 8e2a8a90432874362a9e9e3be1c0bf989fb126c2 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 911f6ea9be0c334885aeff66853b111cbd4066df Mon Sep 17 00:00:00 2001
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002From: "Maxin B. John" <maxin.john@intel.com>
3Date: Wed, 10 Feb 2016 17:28:05 +0200
4Subject: [PATCH] mdadm-fix-ptest-build-errors
5
6builds fail with ptest enabled:
7
8| restripe.c: In function 'test_stripes':
9| restripe.c:845:4: error: ignoring return value of 'read', declared with
10| attribute warn_unused_result [-Werror=unused-result]
11| read(source[i], stripes[i], chunk_size);
12| ^
13| cc1: all warnings being treated as errors
14| Makefile:214: recipe for target 'test_stripe' failed
15
16Upstream-Status: Pending
17
18Signed-off-by: Maxin B. John <maxin.john@intel.com>
Brad Bishop19323692019-04-05 15:28:33 -040019
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050020---
21 restripe.c | 6 +++++-
22 1 file changed, 5 insertions(+), 1 deletion(-)
23
24diff --git a/restripe.c b/restripe.c
Brad Bishop19323692019-04-05 15:28:33 -040025index 31b07e8..592ba5d 100644
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050026--- a/restripe.c
27+++ b/restripe.c
Brad Bishop19323692019-04-05 15:28:33 -040028@@ -864,10 +864,14 @@ int test_stripes(int *source, unsigned long long *offsets,
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050029
30 while (length > 0) {
31 int disk;
32+ ssize_t ret;
33
34 for (i = 0 ; i < raid_disks ; i++) {
35 lseek64(source[i], offsets[i]+start, 0);
36- read(source[i], stripes[i], chunk_size);
37+ ret = read(source[i], stripes[i], chunk_size);
38+ if (ret == -1) {
39+ printf("Read Failed\n");
40+ }
41 }
42 for (i = 0 ; i < data_disks ; i++) {
43 int disk = geo_map(i, start/chunk_size, raid_disks,