2022-12-19 02:02:20

by wangjianjian (C)

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

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 <[email protected]>
---
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


2023-02-09 15:57:37

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH 1/1] ext4: Don't show commit interval if it is zero

On Mon, 19 Dec 2022 09:51:28 +0800, Wang Jianjian wrote:
> If commit interval is 0, it means using default value.
>
>

Applied, thanks!

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

Best regards,
--
Theodore Ts'o <[email protected]>

2023-02-24 20:07:14

by Dmytro Maluka

[permalink] [raw]
Subject: Re: [PATCH 1/1] ext4: Don't show commit interval if it is zero

On 12/19/22 02:51, 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 <[email protected]>
> ---
> 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, "

Hi,

Thanks for this fix, I just have some remarks about its description in
the commit log.

I think the bug fixed by this patch is more severe than the description
suggests: it's not just about showing or not showing commit interval
(btw I'm not sure what does "show" mean here), it's about setting
incorrect commit interval (0 instead of JBD2_DEFAULT_MAX_COMMIT_AGE*HZ)
when mounting ext4 with default settings.

Also I believe the "Fixes:" tag is misleading: it actually fixes commit
461c3af045d3 ("ext4: Change handle_mount_opt() to use fs_parameter").

This bug introduced in 461c3af045d3 causes a significant performance
degradation at least in certain setups, for instance I'm observing ~10x
performance drop in direct I/O write tests with PSEDN128GA17DC0 SSD disk
and PS5013 E13 NVMe controller.

Ted, I see you've already merged this fix into ext4 dev branch, but I
guess it's not too late to amend the commit message before it gets into
mainline?

Thanks,
Dmytro