Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | From 911f6ea9be0c334885aeff66853b111cbd4066df Mon Sep 17 00:00:00 2001 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 2 | From: "Maxin B. John" <maxin.john@intel.com> |
| 3 | Date: Wed, 10 Feb 2016 17:28:05 +0200 |
| 4 | Subject: [PATCH] mdadm-fix-ptest-build-errors |
| 5 | |
| 6 | builds 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 | |
| 16 | Upstream-Status: Pending |
| 17 | |
| 18 | Signed-off-by: Maxin B. John <maxin.john@intel.com> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 19 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 20 | --- |
| 21 | restripe.c | 6 +++++- |
| 22 | 1 file changed, 5 insertions(+), 1 deletion(-) |
| 23 | |
| 24 | diff --git a/restripe.c b/restripe.c |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 25 | index 31b07e8..592ba5d 100644 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | --- a/restripe.c |
| 27 | +++ b/restripe.c |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 28 | @@ -864,10 +864,14 @@ int test_stripes(int *source, unsigned long long *offsets, |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 29 | |
| 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, |