Return-Path: Received: from mail-sn1nam01on0117.outbound.protection.outlook.com ([104.47.32.117]:16747 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965335AbeCHFDS (ORCPT ); Thu, 8 Mar 2018 00:03:18 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Shaohua Li , Guoqing Jiang , NeilBrown , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 133/190] md/raid10: skip spare disk as 'first' disk Date: Thu, 8 Mar 2018 04:59:50 +0000 Message-ID: <20180308045810.8041-133-alexander.levin@microsoft.com> References: <20180308045810.8041-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045810.8041-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Shaohua Li [ Upstream commit b506335e5d2b4ec687dde392a3bdbf7601778f1d ] Commit 6f287ca(md/raid10: reset the 'first' at the end of loop) ignores a case in reshape, the first rdev could be a spare disk, which shouldn't be accounted as the first disk since it doesn't include the offset info. Fix: 6f287ca(md/raid10: reset the 'first' at the end of loop) Cc: Guoqing Jiang Cc: NeilBrown Signed-off-by: Shaohua Li Signed-off-by: Sasha Levin --- drivers/md/raid10.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index b1daff78f7b2..18a4271bf569 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4089,6 +4089,7 @@ static int raid10_start_reshape(struct mddev *mddev) diff =3D 0; if (first || diff < min_offset_diff) min_offset_diff =3D diff; + first =3D 0; } } =20 --=20 2.14.1