Re: [PATCH RFC 5/8] ext4: use super write guard in write_mmp_block()

Daniel Vacek
2025-11-05T18:33:47Z

On Tue, 4 Nov 2025 at 13:16, Christian Brauner <brauner@kernel.org> wrote:
>
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> ---
> fs/ext4/mmp.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
> index ab1ff51302fb..6f57c181ff77 100644
> --- a/fs/ext4/mmp.c
> +++ b/fs/ext4/mmp.c
> @@ -57,16 +57,12 @@ static int write_mmp_block_thawed(struct super_block *sb,
>
> static int write_mmp_block(struct super_block *sb, struct buffer_head *bh)
> {
> - int err;
> -
> /*
> * We protect against freezing so that we don't create dirty buffers
> * on frozen filesystem.
> */
> - sb_start_write(sb);
> - err = write_mmp_block_thawed(sb, bh);
> - sb_end_write(sb);
> - return err;
> + scoped_guard(super_write, sb)
> + return write_mmp_block_thawed(sb, bh);

Why the scoped_guard here? Should the simple guard(super_write)(sb) be
just as fine here?

--nX

> }
>
> /*
>
> --
> 2.47.3
>
>