[PATCH v2 31/34] ext4: use the generic emergency read-only state
Jan Kara
jack at suse.cz
Thu Nov 5 01:32:57 PST 2026
On Thu 29-10-26 17:07:22, Christian Brauner wrote:
> Set SB_STATE_EMERGENCY_RO next to EXT4_FLAGS_EMERGENCY_RO when an error
> makes the filesystem read-only. The VFS then refuses modifications
> before they reach ext4 and reports the superblock as read-only like it
> did when ext4 still set SB_RDONLY. The shutdown state stays ext4's own
> and so do all of ext4's checks because they cover both states. ext4
> keeps showing "emergency_ro" in its mount options.
>
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
Looks good! Feel free to add:
Reviewed-by: Jan Kara <jack at suse.cz>
Honza
> ---
> fs/ext4/super.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index ae5ba6823c01..afbdbb607b14 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -757,6 +757,7 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
> * and other problems.
> */
> set_bit(EXT4_FLAGS_EMERGENCY_RO, &EXT4_SB(sb)->s_ext4_flags);
> + sb_set_emergency_ro(sb);
> }
>
> static void update_super_work(struct work_struct *work)
>
> --
> 2.53.0
>
--
Jan Kara <jack at suse.com>
SUSE Labs, CR
More information about the linux-mtd
mailing list