[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZHOTzAzRCwaekt+9@debian-BULLSEYE-live-builder-AMD64>
Date: Sun, 28 May 2023 13:47:56 -0400
From: Eric Whitney <enwlinux@...il.com>
To: Theodore Ts'o <tytso@....edu>
Cc: Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: enable the lazy init thread when remounting
read/write
* Theodore Ts'o <tytso@....edu>:
> In commit a44be64bbecb ("ext4: don't clear SB_RDONLY when remounting
> r/w until quota is re-enabled") we defer clearing tyhe SB_RDONLY flag
> in struct super. However, we didn't defer when we checked sb_rdonly()
> to determine the lazy itable init thread should be enabled, with the
> next result that the lazy inode table initialization would not be
> properly started. This can cause generic/231 to fail in ext4's
> nojournal mode.
>
> Fix this by moving when we decide to start or stop the lazy itable
> init thread to after we clear the SB_RDONLY flag when we are
> remounting the file system read/write.
>
> Fixes a44be64bbecb ("ext4: don't clear SB_RDONLY when remounting r/w until...")
> Signed-off-by: Theodore Ts'o <tytso@....edu>
> ---
> fs/ext4/super.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 9680fe753e59..56a5d1c469fc 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -6588,18 +6588,6 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
> }
> }
>
> - /*
> - * Reinitialize lazy itable initialization thread based on
> - * current settings
> - */
> - if (sb_rdonly(sb) || !test_opt(sb, INIT_INODE_TABLE))
> - ext4_unregister_li_request(sb);
> - else {
> - ext4_group_t first_not_zeroed;
> - first_not_zeroed = ext4_has_uninit_itable(sb);
> - ext4_register_li_request(sb, first_not_zeroed);
> - }
> -
> /*
> * Handle creation of system zone data early because it can fail.
> * Releasing of existing data is done when we are sure remount will
> @@ -6637,6 +6625,18 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
> if (enable_rw)
> sb->s_flags &= ~SB_RDONLY;
>
> + /*
> + * Reinitialize lazy itable initialization thread based on
> + * current settings
> + */
> + if (sb_rdonly(sb) || !test_opt(sb, INIT_INODE_TABLE))
> + ext4_unregister_li_request(sb);
> + else {
> + ext4_group_t first_not_zeroed;
> + first_not_zeroed = ext4_has_uninit_itable(sb);
> + ext4_register_li_request(sb, first_not_zeroed);
> + }
> +
> if (!ext4_has_feature_mmp(sb) || sb_rdonly(sb))
> ext4_stop_mmpd(sbi);
>
> --
> 2.31.0
>
Hi Ted:
100/100 trials of generic/231 with nojournal passed when I used kvm-xfstests
to run it on a 6.4-rc3 kernel modified with this patch. A complete run of the
nojournal test case also passed for me without new regressions.
So,
Tested-by: Eric Whitney <enwlinux@...il.com>
Thanks,
Eric
Powered by blists - more mailing lists