diff mbox series

[1/1] ext4: Don't show commit interval if it is zero

Message ID 20221219015140.877136-1-wangjianjian3@huawei.com
State Awaiting Upstream
Headers show
Series [1/1] ext4: Don't show commit interval if it is zero | expand

Commit Message

wangjianjian (C) Dec. 19, 2022, 1:51 a.m. UTC
If commit interval is 0, it means using default value.

Fixes: 6e47a3cc68fc ("ext4: get rid of super block and sbi from handle_mount_ops()")
Signed-off-by: Wang Jianjian <wangjianjian3@huawei.com>
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

wangjianjian (C) Dec. 29, 2022, 2:34 a.m. UTC | #1
Any comment about this ? I think this is a regression.
Lukas Czerner Jan. 2, 2023, 11:12 a.m. UTC | #2
Hi,

good catch, this is indeed a bug. You could also fix the xfstest ext4/053
which missed this problem.

You can add

Reviewed-by: Lukas Czerner <lczerner@redhat.com>

On Mon, Dec 19, 2022 at 09:51:40AM +0800, Wang Jianjian wrote:
> If commit interval is 0, it means using default value.
> 
> Fixes: 6e47a3cc68fc ("ext4: get rid of super block and sbi from handle_mount_ops()")
> Signed-off-by: Wang Jianjian <wangjianjian3@huawei.com>
> ---
>  fs/ext4/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 16a343e8047d..b93911d80cd9 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -2146,7 +2146,7 @@ static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param)
>  		return 0;
>  	case Opt_commit:
>  		if (result.uint_32 == 0)
> -			ctx->s_commit_interval = JBD2_DEFAULT_MAX_COMMIT_AGE;
> +			result.uint_32 = JBD2_DEFAULT_MAX_COMMIT_AGE;
>  		else if (result.uint_32 > INT_MAX / HZ) {
>  			ext4_msg(NULL, KERN_ERR,
>  				 "Invalid commit interval %d, "
> -- 
> 2.32.0
>
diff mbox series

Patch

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 16a343e8047d..b93911d80cd9 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2146,7 +2146,7 @@  static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param)
 		return 0;
 	case Opt_commit:
 		if (result.uint_32 == 0)
-			ctx->s_commit_interval = JBD2_DEFAULT_MAX_COMMIT_AGE;
+			result.uint_32 = JBD2_DEFAULT_MAX_COMMIT_AGE;
 		else if (result.uint_32 > INT_MAX / HZ) {
 			ext4_msg(NULL, KERN_ERR,
 				 "Invalid commit interval %d, "