diff mbox

[2/2] ext4: Do not use stripe_with if it is not set

Message ID 20170209153050.15317-2-jack@suse.cz
State Awaiting Upstream, archived
Headers show

Commit Message

Jan Kara Feb. 9, 2017, 3:30 p.m. UTC
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>
---
 fs/ext4/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Theodore Ts'o Feb. 10, 2017, 5:57 a.m. UTC | #1
On Thu, Feb 09, 2017 at 04:30:50PM +0100, Jan Kara wrote:
> 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>

Thanks, applied.

					- Ted
Theodore Ts'o Feb. 10, 2017, 6 a.m. UTC | #2
On Thu, Feb 09, 2017 at 04:30:50PM +0100, Jan Kara wrote:
> 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>

Thanks, applied.

					- Ted
diff mbox

Patch

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 66845a08a87a..b82cd3b263b4 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2619,9 +2619,9 @@  static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi)
 
 	if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group)
 		ret = sbi->s_stripe;
-	else if (stripe_width <= sbi->s_blocks_per_group)
+	else if (stripe_width && stripe_width <= sbi->s_blocks_per_group)
 		ret = stripe_width;
-	else if (stride <= sbi->s_blocks_per_group)
+	else if (stride && stride <= sbi->s_blocks_per_group)
 		ret = stride;
 	else
 		ret = 0;