Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754691AbdC1Jva (ORCPT ); Tue, 28 Mar 2017 05:51:30 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:57233 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbdC1Jv2 (ORCPT ); Tue, 28 Mar 2017 05:51:28 -0400 From: Arnd Bergmann To: Shaohua Li Cc: Arnd Bergmann , NeilBrown , Ming Lei , Jens Axboe , "colyli@suse.de" , Guoqing Jiang , Mike Christie , linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Revert "md: raid1: use bio helper in process_checks()" Date: Tue, 28 Mar 2017 11:49:57 +0200 Message-Id: <20170328095029.3500369-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:BVLTkxCiCwRAaKB9quyzFi1Mj9ni30RW5egkJ3CsdkUxEO2RFTA +GQ/OSEDKlsq6U20U+AP6Zb1DrsdASo9NvY3sOV9VZ373cDa9+JF5MZE253Z7Xzr99G6v0m RL6xTwHuN4J16TSBSFmNCKyxKzgcIKg0GgRFL9uAPh2mdi7hyJ6z6VwoxjoGK28n/KkZbp1 RejWvVzxqPd1w45/KVODw== X-UI-Out-Filterresults: notjunk:1;V01:K0:ynH2ODhK4mQ=:T4jZiZKxqsyoubiA0leCsN ItxJ8L/W43fN20JZo9GtYyKkPvuUjG6juUWF84AKHHC7pbhUjDe3Q4HydSuJeojohU2QnJgax afLABA5H7l+JtdBk3sAf6DrGCmQQ+jybNPs6/t85tBIL1Xescf0Xgmr0DKZhWz1Z6aRxkWq6S PhL6roeY2SBGKtk4W9bPsuz/aYzb1HBL/SSRU9N2XNAL66UVqEQpUQI4GZMUjbWQvDKa7Feqg vDXD3vEYn6DRQERFWyJLW6oaJA2tUpH6G8Nra0UaOQHyKAMt5wjAf0TOPLNzt1Pmjbhm5zBaR tWwSRhAMbtBocQk1S/RZjqPsmb+RpeP/BqizT2JwO8z4kKhdP0p3kypC5GyFZLlrY5cX1C4vu 4v/dtOyU/Rs03dfA4ATNLJmVHvgFmxV/ZOBMn8J4IxU74UiYbDsoSTSUt0QMqdlf8HkJ5FZZJ QNUoVOgW7yJwaAHC+07o8kJMiAZ2D+wXj+J9U+fUO8oL5Wdx5F2lLi/GLgnQBU6HvGftLbrKq e+8YXX5u9bvRpM2KVY3hCFYqPPuR4T6ReyHp6uu85zco1X0nhM2AxcuCZCbAk+y461YCW8Iap U7x8QnDqglf4oHSwk3yi3Vv/ECCF9ln4n3qyundSnZs6p389IS8ynYGRqn0GcQ8WInhnth7no 0FxZvesG4OLdDx/TGqxVSlSlCOTZ8zqQjyWDNVVDcqsxrrkXCbhBAcADEGjhfZnXYHbA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2329 Lines: 73 Commit 60928a91b0b3 ("md: raid1: use bio helper in process_checks()") is probably correct, but I get a new compile-time warning after it, and have trouble understanding what it fixes: drivers/md/raid1.c: In function 'sync_request_write': drivers/md/raid1.c:2172:9: error: 'page_len$' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (memcmp(page_address(ppages[j]), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ page_address(spages[j]), ~~~~~~~~~~~~~~~~~~~~~~~~ page_len[j])) ~~~~~~~~~~~~ drivers/md/raid1.c:2160:7: note: 'page_len$' was declared here int page_len[RESYNC_PAGES]; ^~~~~~~~ This reverts it to resolve the warning. Fixes: 60928a91b0b3 ("md: raid1: use bio helper in process_checks()") Signed-off-by: Arnd Bergmann --- drivers/md/raid1.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index b7d9651286d4..4d176c8abc33 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2113,7 +2113,6 @@ static void process_checks(struct r1bio *r1_bio) int j; int size; int error; - struct bio_vec *bi; struct bio *b = r1_bio->bios[i]; struct resync_pages *rp = get_resync_pages(b); if (b->bi_end_io != end_sync_read) @@ -2132,7 +2131,9 @@ static void process_checks(struct r1bio *r1_bio) b->bi_private = rp; size = b->bi_iter.bi_size; - bio_for_each_segment_all(bi, b, j) { + for (j = 0; j < vcnt ; j++) { + struct bio_vec *bi; + bi = &b->bi_io_vec[j]; bi->bv_offset = 0; if (size > PAGE_SIZE) bi->bv_len = PAGE_SIZE; @@ -2156,22 +2157,17 @@ static void process_checks(struct r1bio *r1_bio) int error = sbio->bi_error; struct page **ppages = get_resync_pages(pbio)->pages; struct page **spages = get_resync_pages(sbio)->pages; - struct bio_vec *bi; - int page_len[RESYNC_PAGES]; if (sbio->bi_end_io != end_sync_read) continue; /* Now we can 'fixup' the error value */ sbio->bi_error = 0; - bio_for_each_segment_all(bi, sbio, j) - page_len[j] = bi->bv_len; - if (!error) { for (j = vcnt; j-- ; ) { if (memcmp(page_address(ppages[j]), page_address(spages[j]), - page_len[j])) + sbio->bi_io_vec[j].bv_len)) break; } } else -- 2.9.0