Return-Path: Received: from mail-cys01nam02on0090.outbound.protection.outlook.com ([104.47.37.90]:35342 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966738AbeCHFLf (ORCPT ); Thu, 8 Mar 2018 00:11:35 -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 3.18 39/53] md/raid10: skip spare disk as 'first' disk Date: Thu, 8 Mar 2018 05:03:24 +0000 Message-ID: <20180308050230.8876-39-alexander.levin@microsoft.com> References: <20180308050230.8876-1-alexander.levin@microsoft.com> In-Reply-To: <20180308050230.8876-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 d207748fdc41..432c17fa636e 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4132,6 +4132,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