From patchwork Thu Feb 16 11:45:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9576951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 570F6600C5 for ; Thu, 16 Feb 2017 11:50:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53E242855B for ; Thu, 16 Feb 2017 11:50:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46444285B7; Thu, 16 Feb 2017 11:50:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C67592855B for ; Thu, 16 Feb 2017 11:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754760AbdBPLqj (ORCPT ); Thu, 16 Feb 2017 06:46:39 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35848 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754759AbdBPLqh (ORCPT ); Thu, 16 Feb 2017 06:46:37 -0500 Received: by mail-pg0-f67.google.com with SMTP id 13so884851pgd.3; Thu, 16 Feb 2017 03:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+mPPTbL7aaTKspjcGnnFO5iuUkJlgW3DspC1iyR2RLI=; b=a4g833VlGe/qDq6xXQ//WFkobnH9CPjaqJxXps0tXaGvM/WwJx/GQUgRW4NulTxUWh YGpXqIAI72b9To3L5x3fUHFzUK0xaKILyula6XNmDi7VKt2r0Ou8h2HDocVVpx9hplGR DL4fjtNlVaIYkvcDn+aUBsGQcEk8tzVzWojx9J+8BN21bBEzoswbkDU0Z9bTPlZSg++8 rsY/zTD2z3N1v5vgBhsVs+VRZt5NW8xmeMgXWUWkuPrWCiEzr+xJjA7Uy3sv6FxlVyta a6SmEL2RqbaOz7rmgwepqho6G+trCBq3uLSBC149XX8BFijZCUJHPMUN7PhVm9eqQs3I TA4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+mPPTbL7aaTKspjcGnnFO5iuUkJlgW3DspC1iyR2RLI=; b=aJJSKD0FWBv6B+mCJUgJOnpEWcYIdBrudPMQj145oLAANe/XamCR+jjfQYK4EPueYt PwfBGo3BrfAxGGRErtSHso/EQ3pWdQQrGDnPZZhgTtO59JHWFL70eJ+VFmKhv2HTv8fv DamtT/9vbyFj+3Ov5QAXbNNxsk9TYjJXTUWOI4CjeyLs3Cf+jUvDmh4LxVPmRWy2Wdyo o/wZQWE17XFgUXADbxs4btIWGzfZSyXruyLUOJg7Y4fw88HjHshGp/lsE8aXV6X6Ff2C HcXyUd1sesbmPLqHGJ9JObW/GMDGgL0MNjyHFOX9gWjY6EL0PuWVODK1jX5bFqCfZkea em4A== X-Gm-Message-State: AMke39l20bRFJfHifBcyYNsyuSJrc+CRprAJneEAdbZB4ShaQd9vv74BdHu0gFFIXGf5+A== X-Received: by 10.99.102.70 with SMTP id a67mr2319383pgc.222.1487245591666; Thu, 16 Feb 2017 03:46:31 -0800 (PST) Received: from localhost (li405-222.members.linode.com. [106.187.53.222]) by smtp.gmail.com with ESMTPSA id o66sm13238803pfa.119.2017.02.16.03.46.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 03:46:30 -0800 (PST) From: Ming Lei To: Shaohua Li , Jens Axboe , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-block@vger.kernel.org, Christoph Hellwig , NeilBrown Cc: Ming Lei Subject: [PATCH 07/17] md: raid1/raid10: don't use .bi_vcnt to check if all pages are added Date: Thu, 16 Feb 2017 19:45:37 +0800 Message-Id: <1487245547-24384-8-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487245547-24384-1-git-send-email-tom.leiming@gmail.com> References: <1487245547-24384-1-git-send-email-tom.leiming@gmail.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead we use the index of the pre-allocated pages buffer, it should be more explicit because the index(.bi_error) just means how many pages are added to the bio. Signed-off-by: Ming Lei --- drivers/md/raid1.c | 2 +- drivers/md/raid10.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 8904a9149671..23a3a678a9ed 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2835,7 +2835,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, nr_sectors += len>>9; sector_nr += len>>9; sync_blocks -= (len>>9); - } while (r1_bio->bios[disk]->bi_vcnt < RESYNC_PAGES); + } while (r1_bio->bios[disk]->bi_error < RESYNC_PAGES); bio_full: /* return .bi_error back to bio */ for (i = 0 ; i < conf->raid_disks * 2; i++) { diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 9cfc22cd1330..8262f3e1dd93 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3453,7 +3453,7 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, } nr_sectors += len>>9; sector_nr += len>>9; - } while (biolist->bi_vcnt < RESYNC_PAGES); + } while (biolist->bi_error < RESYNC_PAGES); bio_full: /* return .bi_error back to bio, and set resync's as -EIO */ for (bio= biolist ; bio ; bio=bio->bi_next)