Return-Path: Received: from fldsmtpe03.verizon.com ([140.108.26.142]:18311 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753737AbdJGWjI (ORCPT ); Sat, 7 Oct 2017 18:39:08 -0400 From: "Levin, Alexander (Sasha Levin)" Cc: Jan Kara , Theodore Ts'o , "Levin, Alexander (Sasha Levin)" To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH review for 3.18 04/12] ext4: do not use stripe_width if it is not set Date: Sat, 7 Oct 2017 22:37:59 +0000 Message-ID: <20171007223752.25085-4-alexander.levin@verizon.com> References: <20171007223752.25085-1-alexander.levin@verizon.com> In-Reply-To: <20171007223752.25085-1-alexander.levin@verizon.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: Jan Kara [ Upstream commit 5469d7c3087ecaf760f54b447f11af6061b7c897 ] Avoid using stripe_width for sbi->s_stripe value if it is not actually set. It prevents using the stride for sbi->s_stripe. Signed-off-by: Jan Kara Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index a64e4368bb58..359d5e57eac7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2441,9 +2441,9 @@ static unsigned long ext4_get_stripe_size(struct ext4= _sb_info *sbi) =20 if (sbi->s_stripe && sbi->s_stripe <=3D sbi->s_blocks_per_group) ret =3D sbi->s_stripe; - else if (stripe_width <=3D sbi->s_blocks_per_group) + else if (stripe_width && stripe_width <=3D sbi->s_blocks_per_group) ret =3D stripe_width; - else if (stride <=3D sbi->s_blocks_per_group) + else if (stride && stride <=3D sbi->s_blocks_per_group) ret =3D stride; else ret =3D 0; --=20 2.11.0