Return-Path: 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 4.9 15/50] ext4: do not use stripe_width if it is not set Date: Sat, 7 Oct 2017 22:36:49 +0000 Message-ID: <20171007223636.24797-15-alexander.levin@verizon.com> References: <20171007223636.24797-1-alexander.levin@verizon.com> In-Reply-To: <20171007223636.24797-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: linux-kernel-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 f72535e1898f..1f581791b39d 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2628,9 +2628,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