From patchwork Thu Mar 16 16:12:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9628849 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 E8E0960244 for ; Thu, 16 Mar 2017 16:15:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D940F283F9 for ; Thu, 16 Mar 2017 16:15:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE6422841E; Thu, 16 Mar 2017 16:15:09 +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=ham 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 839E8283F9 for ; Thu, 16 Mar 2017 16:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755164AbdCPQOy (ORCPT ); Thu, 16 Mar 2017 12:14:54 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34463 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755151AbdCPQOv (ORCPT ); Thu, 16 Mar 2017 12:14:51 -0400 Received: by mail-pf0-f193.google.com with SMTP id o126so6268981pfb.1; Thu, 16 Mar 2017 09:14:50 -0700 (PDT) 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=nAjSVZgND9W0g6wNOdjNebKpg58GD94LWPe1C066LbU=; b=oG6IH5Qvv4VDXrVqaLfWkcG+1jPZZDUnES+GXpn7u7A3zVcbPYeqefBqZ15SXU9MdS 8H1tFJNRVO7+xunf546wL2fIw2enxwzIU+wXXj96kTXpNNVV8Dgo3u19ZZp4MF70yR25 J6SDMNdFGoAUJo1dqw4HurJmwVAnUUSN4xooGEfgaRPHp3IHHnoioBV8g3nunhRKm+9s QkAMSOwdtKjcReko3icXPPczjBx39Qvn5ZJlfmNKC9KUer+wiNEvX5E2leQU1/y0wrX9 pRJ9OZa8SADhwnfwMgvSKdM2oPFFg23UPu8bBRL4O9Cr/UDmprq5vNiP7bTSiciD4Smx CDXg== 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=nAjSVZgND9W0g6wNOdjNebKpg58GD94LWPe1C066LbU=; b=ILOVBrGxPvjI8QqS13Wlmtttk9QzA6WtRGd+8MJUI0gCDWhGGtB5NVWIUbqpIfU8KT cvLxTUw5qWJODljoneLoI8HpBdSE4XsW8mszsQrclAwx4B+vrrRa/t3SUaMvP/nugnti nv1K5plaPONjWTc1/P5Su3k4XTNfPn19f9QXso5XOTL2GBAMLeBKXcsvXNuR33JOjnBG ezF/oz99CrBFxy8HOeN7sI846fNBEAP8ENih+wYWUfaLhJmOXCt/LMEkRNpjAZMI21kP 8bZULILRChtFPxSzzkc8troGZm6jbuXKMgf0DKEp+5vzeZ7qfFyif9iTVj2cOrTzDfF/ 2A9g== X-Gm-Message-State: AFeK/H0jrAaQQeZaS13pQd9+bynlGx49NKnQW56I1TQumwyQgwNOwiN4Af+D5hkd2i7xLQ== X-Received: by 10.84.175.132 with SMTP id t4mr13153023plb.38.1489680890460; Thu, 16 Mar 2017 09:14:50 -0700 (PDT) Received: from localhost ([103.192.224.52]) by smtp.gmail.com with ESMTPSA id s3sm11580124pgn.55.2017.03.16.09.14.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Mar 2017 09:14:49 -0700 (PDT) From: Ming Lei To: Shaohua Li , Jens Axboe , linux-raid@vger.kernel.org, linux-block@vger.kernel.org, Christoph Hellwig Cc: Ming Lei Subject: [PATCH v3 14/14] md: raid10: avoid direct access to bvec table in handle_reshape_read_error Date: Fri, 17 Mar 2017 00:12:35 +0800 Message-Id: <20170316161235.27110-15-tom.leiming@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170316161235.27110-1-tom.leiming@gmail.com> References: <20170316161235.27110-1-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 All reshape I/O share pages from 1st copy device, so just use that pages for avoiding direct access to bvec table in handle_reshape_read_error. Signed-off-by: Ming Lei --- drivers/md/raid10.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 8db3b0869be4..67cf09c0c649 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4681,7 +4681,10 @@ static int handle_reshape_read_error(struct mddev *mddev, struct r10bio *r10b = &on_stack.r10_bio; int slot = 0; int idx = 0; - struct bio_vec *bvec = r10_bio->master_bio->bi_io_vec; + struct page **pages; + + /* reshape IOs share pages from .devs[0].bio */ + pages = get_resync_pages(r10_bio->devs[0].bio)->pages; r10b->sector = r10_bio->sector; __raid10_find_phys(&conf->prev, r10b); @@ -4710,7 +4713,7 @@ static int handle_reshape_read_error(struct mddev *mddev, success = sync_page_io(rdev, addr, s << 9, - bvec[idx].bv_page, + pages[idx], REQ_OP_READ, 0, false); rdev_dec_pending(rdev, mddev); rcu_read_lock();