Skip to content

Commit cdd33b9

Browse files
jankaratytso
authored andcommitted
ext4: do not use stripe_with if it is not set
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>
1 parent d9b22cf commit cdd33b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ext4/super.c

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

26382638
if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group)
26392639
ret = sbi->s_stripe;
2640-
else if (stripe_width <= sbi->s_blocks_per_group)
2640+
else if (stripe_width && stripe_width <= sbi->s_blocks_per_group)
26412641
ret = stripe_width;
2642-
else if (stride <= sbi->s_blocks_per_group)
2642+
else if (stride && stride <= sbi->s_blocks_per_group)
26432643
ret = stride;
26442644
else
26452645
ret = 0;

0 commit comments

Comments
 (0)