Received: by 10.213.65.68 with SMTP id h4csp704281imn; Fri, 6 Apr 2018 07:33:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Z3NxqrZXIDhVmuVd4GytPjztwZsSSMBehh2fpJPtDZlV2qPbo75YlFgvUygzs6KM0rO9C X-Received: by 10.99.109.72 with SMTP id i69mr18316326pgc.417.1523025220058; Fri, 06 Apr 2018 07:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523025220; cv=none; d=google.com; s=arc-20160816; b=oap4gnY4c9cuy50IvZZzNn8MZ/vVqIcPSEOfEJaq1zsyi6Wj/P3aelNJltQrY8WsqQ JnVy7FEW7qicECw85JnH2dCNSGg4IDMRDAmCIWdp5TNa4g40mRUtmO1OdD4RER2J1v06 usPnAkxpeAxt61aPaHNAw58DxVDVejfP7DEYENFOGgV/bQ2v691HlY3H2uq9gTzk7cZJ S56dEZE2kPCWN40qhbP7fnveNxyO1TF9ZVqmlex7lWOJVe+My3LIt4RjFQuGueEflUFs 7gZV4fq7E0EXP8VF9JNmFYp6Nn5qIgBPIVXaUwxxyhl8+5e6F1YJn8vpR5c8uW1052cs NOfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tAqK9NU8PBHPtf0ahUM6t8gpy/qw2u0ylIzwRyjVjg0=; b=w1r9bZ1YdVOivmW4+DjOjhopxaPvDdb7Fc26vwrHcLLUfetyuwnpiGm/gp8fijHRNy 4gXkWoyb2bZGSkxQi4TSjdRpxEk0hAPnwLSDiGXj70XusgXSV62CahkXSeDKh7WOlgy9 UlIom3dBANXwxv7uldReoGbVLKf3hpLBbXGRSS1j1lGyx1t3E56bL3DIbDqn89XKFTja Gala9D+qKkTeFT49gH1Wwm9en2x4e8U0FrIa+RS3Zx8Hl6cJDfQrHbqcq7DN0D0JsQIS ZYWc3DWE2lRQZ4JdvWQIjg530vXiL6aHK/N348DKQW0fMPzMoj9PiXr0CCE0bjhmBYWi JmqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g62si4816422pgc.693.2018.04.06.07.33.13; Fri, 06 Apr 2018 07:33:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756238AbeDFNgs (ORCPT + 99 others); Fri, 6 Apr 2018 09:36:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59816 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755920AbeDFNgq (ORCPT ); Fri, 6 Apr 2018 09:36:46 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7A806890; Fri, 6 Apr 2018 13:36:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, NeilBrown , Guoqing Jiang , Shaohua Li , Ben Hutchings Subject: [PATCH 4.9 094/102] md/raid10: reset the first at the end of loop Date: Fri, 6 Apr 2018 15:24:15 +0200 Message-Id: <20180406084344.705659568@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guoqing Jiang commit 6f287ca6046edd34ed83aafb7f9033c9c2e809e2 upstream. We need to set "first = 0' at the end of rdev_for_each loop, so we can get the array's min_offset_diff correctly otherwise min_offset_diff just means the last rdev's offset diff. [only the first chunk, due to b506335e5d2b ("md/raid10: skip spare disk as 'first' disk") being already applied - gregkh] Suggested-by: NeilBrown Signed-off-by: Guoqing Jiang Reviewed-by: NeilBrown Signed-off-by: Shaohua Li Cc: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid10.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3681,6 +3681,7 @@ static int raid10_run(struct mddev *mdde if (blk_queue_discard(bdev_get_queue(rdev->bdev))) discard_supported = true; + first = 0; } if (mddev->queue) {