Skip to content

Commit 3580080

Browse files
jankaragregkh
authored andcommitted
ext4: do not use stripe_width if it is not set
[ 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 <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5624ea1 commit 3580080

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/ext4/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,9 +2499,9 @@ static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi)
24992499

25002500
if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group)
25012501
ret = sbi->s_stripe;
2502-
else if (stripe_width <= sbi->s_blocks_per_group)
2502+
else if (stripe_width && stripe_width <= sbi->s_blocks_per_group)
25032503
ret = stripe_width;
2504-
else if (stride <= sbi->s_blocks_per_group)
2504+
else if (stride && stride <= sbi->s_blocks_per_group)
25052505
ret = stride;
25062506
else
25072507
ret = 0;

0 commit comments

Comments
 (0)