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