linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Vitaliy Kuznetsov <vk.en.mail@gmail.com>
Cc: linux-ext4@vger.kernel.org, adilger@dilger.ca
Subject: Re: [PATCH] ext4: Add periodic superblock update check
Date: Fri, 4 Aug 2023 16:58:09 -0400	[thread overview]
Message-ID: <20230804205809.GE903325@mit.edu> (raw)
In-Reply-To: <20230731122526.30158-1-vk.en.mail@gmail.com>

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

  parent reply	other threads:[~2023-08-04 20:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31 12:25 [PATCH] ext4: Add periodic superblock update check Vitaliy Kuznetsov
2023-08-02 21:18 ` Andreas Dilger
2023-08-04 20:58 ` Theodore Ts'o [this message]
2023-08-10 14:38 ` [PATCH v2] " Vitaliy Kuznetsov
2023-08-24  4:53   ` Theodore Ts'o
2023-08-25 12:34     ` Jan Kara
2023-08-26 19:58     ` [PATCH v3] " vk.en.mail
2023-08-28 11:48       ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230804205809.GE903325@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=vk.en.mail@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).