Re: [PATCH] Shrink fast commit buffer when not used

From: Theodore Ts'o
Date: Wed May 11 2022 - 12:33:52 EST


On Thu, Apr 07, 2022 at 07:42:44PM +0700, Shaun Tancheff wrote:
> Shrink the fast-commit buffer when the feature is not
> enabled. By default the fast-commit buffer will allocate 256
> blocks if s_num_fc_blks is 0. Set s_num_fc_blks to a smaller
> value (> 0) to avoid allocating a large unused buffer, this
> also makes more journal credits available when fast commit
> is not used.
>
> Signed-off-by: Shaun Tancheff <shaun.tancheff@xxxxxxx>

The journal->j_superblock data structure is stored on disk, so when
you make this change, it's can and will get written back to disk, at
which point the s_num_fc_blks is permanently strunk. If the file
system might be mounted with the mount option data=journal mode,
fast_commit will be disabled; but it might be subsequently mounted
without this mount option.

Why do you believe this patch is necessary? If there is a file system
which is only going to be mounted using data=journal, the file system
should simply not be formwatted with the fast_commit option.

- Ted