[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mujtxh55om7ykgngu47ujkweevk73fkaqjctkbpboh256boqmd@ortnetu3opdr>
Date: Tue, 21 Jan 2025 14:13:02 +0100
From: Jan Kara <jack@...e.cz>
To: libaokun@...weicloud.com
Cc: linux-ext4@...r.kernel.org, tytso@....edu, adilger.kernel@...ger.ca,
jack@...e.cz, linux-kernel@...r.kernel.org, yi.zhang@...wei.com,
yangerkun@...wei.com, Baokun Li <libaokun1@...wei.com>
Subject: Re: [PATCH 6/7] ext4: show 'emergency_ro' when
EXT4_FLAGS_EMERGENCY_RO is set
On Fri 17-01-25 16:23:14, libaokun@...weicloud.com wrote:
> From: Baokun Li <libaokun1@...wei.com>
>
> After commit d3476f3dad4a ("ext4: don't set SB_RDONLY after filesystem
> errors") in v6.12-rc1, the 'errors=remount-ro' mode no longer sets
> SB_RDONLY on errors, which results in us seeing the filesystem is still
> in rw state after errors.
>
> Therefore, after setting EXT4_FLAGS_EMERGENCY_RO, display the emergency_ro
> option so that users can query whether the current file system has become
> emergency read-only due to errors through commands such as 'mount' or
> 'cat /proc/fs/ext4/sdx/options'.
>
> Fixes: d3476f3dad4a ("ext4: don't set SB_RDONLY after filesystem errors")
> Signed-off-by: Baokun Li <libaokun1@...wei.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> fs/ext4/super.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 8d9ac8770764..2377ebf0aff1 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3029,6 +3029,9 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
> if (nodefs && !test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS))
> SEQ_OPTS_PUTS("prefetch_block_bitmaps");
>
> + if (ext4_emergency_ro(sb))
> + SEQ_OPTS_PUTS("emergency_ro");
> +
> ext4_show_quota_options(seq, sb);
> return 0;
> }
> --
> 2.39.2
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists