[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230804205809.GE903325@mit.edu>
Date: Fri, 4 Aug 2023 16:58:09 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: Vitaliy Kuznetsov <vk.en.mail@...il.com>
Cc: linux-ext4@...r.kernel.org, adilger@...ger.ca
Subject: Re: [PATCH] ext4: Add periodic superblock update check
On Mon, Jul 31, 2023 at 04:25:26PM +0400, Vitaliy Kuznetsov wrote:
> diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c
> index 6d332dff79dd..9f334de4f636 100644
> --- a/fs/ext4/sysfs.c
> +++ b/fs/ext4/sysfs.c
> @@ -515,7 +515,8 @@ static const struct kobj_type ext4_feat_ktype = {
>
> void ext4_notify_error_sysfs(struct ext4_sb_info *sbi)
> {
> - sysfs_notify(&sbi->s_kobj, NULL, "errors_count");
> + if (sbi->s_add_error_count > 0)
> + sysfs_notify(&sbi->s_kobj, NULL, "errors_count");
> }
The problem is that ext4_notify_error_sysfs() is called in
flush_stashed_error_work() **after** that function calls
ext4_update_super() --- and ext4_update_super will zero out
s_add_error_count. So this will result in the sysfs_notify call
*never* getting called, which would be a regression. So
unfortunately, I can't accept this patch as currently written.
Fortunately, only flush_stashed_error_work() calls
ext4_notify_error_sysfs(), so it should be easy enough to sample
s_add_error_count before calling ext4_update_super(), and then
conditionally call sysfs_notify() if it is non-zero.
- Ted
Powered by blists - more mailing lists