Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 1 | From c65898b9da82df94e1bae7937e415a7eb80355d5 Mon Sep 17 00:00:00 2001 |
| 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> |
| 19 | --- |
| 20 | restripe.c | 6 +++++- |
| 21 | 1 file changed, 5 insertions(+), 1 deletion(-) |
| 22 | |
| 23 | diff --git a/restripe.c b/restripe.c |
| 24 | index 56dca73..d24b2b4 100644 |
| 25 | --- a/restripe.c |
| 26 | +++ b/restripe.c |
| 27 | @@ -842,10 +842,14 @@ int test_stripes(int *source, unsigned long long *offsets, |
| 28 | |
| 29 | while (length > 0) { |
| 30 | int disk; |
| 31 | + ssize_t ret; |
| 32 | |
| 33 | for (i = 0 ; i < raid_disks ; i++) { |
| 34 | lseek64(source[i], offsets[i]+start, 0); |
| 35 | - read(source[i], stripes[i], chunk_size); |
| 36 | + ret = read(source[i], stripes[i], chunk_size); |
| 37 | + if (ret == -1) { |
| 38 | + printf("Read Failed\n"); |
| 39 | + } |
| 40 | } |
| 41 | for (i = 0 ; i < data_disks ; i++) { |
| 42 | int disk = geo_map(i, start/chunk_size, raid_disks, |
| 43 | -- |
| 44 | 2.4.0 |
| 45 | |