Received: by 10.213.65.68 with SMTP id h4csp243495imn; Fri, 23 Mar 2018 03:46:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELsWLJmGlNWaun9sHeGOoZur4xPQsanBt+6kn+AS7uKJlQ2IhQRg6GrNfmGXST3ZOmko0k5t X-Received: by 10.98.225.17 with SMTP id q17mr302605pfh.12.1521801975272; Fri, 23 Mar 2018 03:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521801975; cv=none; d=google.com; s=arc-20160816; b=dlVOfyLUhIQoYgWvY3mrSEduLPEHbai0btkVsiuVe8lDY9kaXbxYtozPSojCSsQN37 Nx46k0IMpZ+033xxjpvr7hOZn+i6Z92pIdiqM7C/T5G4Wxlr1Vpvug7sZv5cmWaKvljX 5anlrrmtMAL8aiGrRUUERL7PLSJD1l6uDgpe5vZMsf6zcXHrGs1t4SUKLLsFirvGclFm kGxIKapmSYj1hSZKsIrUEdOFoMpZfnRAKBcdznyG5+cW8flJFDkaiAwrADEg4N3RBplR p1JdWSTJ+03oirS2EHgmH/UtHr0yDsbMc40x8T9bb8mdf/MtnUMVofMSe39TCFoCbQ81 r8vg== 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=/EycqQeDX2166NwEkdUusuaA62q+exWWi02oc5Yyyr8=; b=nfVFEsV1hiJkXS1ob/6RU5oLYnpsfHwGNcMUy6Wkrm4wTyKQJEh17ux+Qe7vofzbRs tn275w2ONYAqz6/+sE2+NW5ONULkHf18hQDqOgTcVTlTHbOCmV9U5B0SiV91rZGknGJL EqzWGO8ERo5+KQToYXQ3oaGxN3bFa6/rQnJ9HHeLeOBI6HRLn6f+1b+1D5pIfQ/z91ck tusSiwEAHDIy1pDT9bPh6VxABOCC9i0VEBMuyh/mdkcBsHj7Wor3Dm38s/2mvVqJrqIk bzKSHwJylGLHDmwAFfq1jUQA4mu5IBTEpnEmFRBmc6QMSrLhH5YOkM/ysgg1rvv/SNBU kegw== 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 w130si6463932pfd.280.2018.03.23.03.46.00; Fri, 23 Mar 2018 03:46:15 -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 S1752477AbeCWKpJ (ORCPT + 99 others); Fri, 23 Mar 2018 06:45:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45772 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933517AbeCWKPl (ORCPT ); Fri, 23 Mar 2018 06:15:41 -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 4B9C812B6; Fri, 23 Mar 2018 10:15:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guoqing Jiang , NeilBrown , Shaohua Li , Sasha Levin Subject: [PATCH 4.4 63/97] md/raid10: skip spare disk as first disk Date: Fri, 23 Mar 2018 10:54:50 +0100 Message-Id: <20180323094201.150412201@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ 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 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 @@ -4044,6 +4044,7 @@ static int raid10_start_reshape(struct m diff = 0; if (first || diff < min_offset_diff) min_offset_diff = diff; + first = 0; } }