Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp578946img; Fri, 22 Mar 2019 04:26:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrKzESU/QwQFPmHFFtXj1GrGJ8FI7NH9hCMlRWA3U9pqeKFyNkefcFt7pZQzYisO8MyFDv X-Received: by 2002:a17:902:76c1:: with SMTP id j1mr7374035plt.224.1553253997815; Fri, 22 Mar 2019 04:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553253997; cv=none; d=google.com; s=arc-20160816; b=FYoFKdowDx2386OINQ/RYZ7od56ZQ8/XKwaJT0V18nf92pjyByFXWoyVLGjSQk2cGn CmP86+xK4tfdY4PniB73MV1GZdUvXe1xpL6L6uDQapD5huZCLRSrgOOqqS8EZoqx34AT 6wC6aCMp4MQi2z6INXzDWI6TNms6BLDH0UW1HxvYx+RLGdnNJkmnxy4GE4127bQSUB2p IjK/A2TbwO+sbLds4sTFRnlbzp9EHUgjbKUWGLAA4rZtNcWzG4hAgK0V0arWuGavDPAA YiOZycNfWbDF50VLFKI6blSWxTKZvNfDYVF7/rBEPt8VxkrNpKF5BFq6CwO1PWnioKkr kHQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nnyJdffS9TD0aBMYwoToRxszyCF6ez0A5aRseokShvQ=; b=0EYARUZnadNZ5CpztlAQ3eiJjutiMIEVhyYxMOAp8x8onp+2s5geiZUwr/MODy0geS Sf7bEShwtFprVTHd38h03hsaMsqBYWtig8X6Yl87OhdN5Dg3t7vyZl2lPX+9Z6RXL8pi 6buVy6xJ7yGMjwj9X4o0XzJ4LoDe+o3iQGmaJeYIYf3vVD4so6WklfsGKBd0SMT3YPBE JCLt4hltw2+jaigf50KdrcIHrQWsyNPJptY70VM62BcrVvdk4kPM56GOSF00/W69voj6 dlW09X/jECnTomm4B1IYN4cjOCsFGKyAqgYZ7wIvr6njvIV+mDrcXf/WfC838DaqhuZj nhQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pkLku4MQ; 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 3si7013870plz.116.2019.03.22.04.26.23; Fri, 22 Mar 2019 04:26:37 -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; dkim=pass header.i=@kernel.org header.s=default header.b=pkLku4MQ; 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 S1729186AbfCVLYt (ORCPT + 99 others); Fri, 22 Mar 2019 07:24:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:51912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728398AbfCVLYs (ORCPT ); Fri, 22 Mar 2019 07:24:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A716820657; Fri, 22 Mar 2019 11:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253888; bh=wJsqrR+Fnf/guWQC9P1hCKCSmHUzyMa7RY5iNzqk+RE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pkLku4MQSZ6pvmVtoobELiog6+7xlSsghnrA76jDPNb7Iad2EVqP6tv55/DBPjFUP S813DFXanwS0DVTttg8wO8jXGENr3gmyp6yu/jNzw1R5ea6kRHE5AOQfxV2H/6lYaW Zi6ioLMjGZ/u8McopdyabZIaxe6NfQxetr4619v0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiao Ni , Song Liu Subject: [PATCH 3.18 094/134] Its wrong to add len to sector_nr in raid10 reshape twice Date: Fri, 22 Mar 2019 12:15:07 +0100 Message-Id: <20190322111216.957712563@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xiao Ni commit b761dcf1217760a42f7897c31dcb649f59b2333e upstream. In reshape_request it already adds len to sector_nr already. It's wrong to add len to sector_nr again after adding pages to bio. If there is bad block it can't copy one chunk at a time, it needs to goto read_more. Now the sector_nr is wrong. It can cause data corruption. Cc: stable@vger.kernel.org # v3.16+ Signed-off-by: Xiao Ni Signed-off-by: Song Liu Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid10.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -4528,7 +4528,6 @@ bio_full: atomic_inc(&r10_bio->remaining); read_bio->bi_next = NULL; generic_make_request(read_bio); - sector_nr += nr_sectors; sectors_done += nr_sectors; if (sector_nr <= last) goto read_more;