Return-Path: Received: from mail-co1nam03on0099.outbound.protection.outlook.com ([104.47.40.99]:24832 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965069AbeCHFG5 (ORCPT ); Thu, 8 Mar 2018 00:06:57 -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.4 068/101] md/raid10: skip spare disk as 'first' disk Date: Thu, 8 Mar 2018 05:02:00 +0000 Message-ID: <20180308050023.8548-68-alexander.levin@microsoft.com> References: <20180308050023.8548-1-alexander.levin@microsoft.com> In-Reply-To: <20180308050023.8548-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 05548af8df6f..3a0d557146c7 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4044,6 +4044,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