mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hyunchul Lee <hyc.lee@gmail.com>
To: Baolin Liu <liubaolin12138@163.com>
Cc: linkinjeon@kernel.org, ntfs@lists.linux.dev,
	linux-kernel@vger.kernel.org, Baolin Liu <liubaolin@kylinos.cn>
Subject: Re: [PATCH v2 2/5] ntfs: report attribute errors to fsnotify
Date: Wed, 16 Sep 2026 16:38:47 +0900	[thread overview]
Message-ID: <aqpHhxKx_xiSoZZQ@hyunchul-PC02> (raw)
In-Reply-To: <20260916022345.1151836-3-liubaolin12138@163.com>

Hi Baolin, 

>  folio_err_out:
> @@ -3720,7 +3737,8 @@ static int ntfs_attr_update_meta(struct attr_record *a, struct ntfs_inode *ni,
>  static int __ntfs_attr_update_mapping_pairs(struct ntfs_inode *ni,
>  					    s64 from_vcn,
>  					    struct ntfs_inode *locked_ni,
> -					    bool defer_attrlist)
> +					    bool defer_attrlist,
> +					    bool *error_reported)
>  {
>  	struct ntfs_attr_search_ctx *ctx;
>  	struct ntfs_inode *base_ni;
> @@ -4086,8 +4104,11 @@ static int __ntfs_attr_update_mapping_pairs(struct ntfs_inode *ni,
>  	return 0;
>  
>  put_err_out:
> -	if (ctx)
> +	if (ctx) {
> +		if (error_reported && ctx->error_reported)
> +			*error_reported = true;
>  		ntfs_attr_put_search_ctx(ctx);
> +	}
>  	return err;
>  }

__ntfs_attr_update_mapping_pairs() does:

  ntfs_attr_put_search_ctx(ctx);
  ctx = NULL

Therefore any later mapping or other errors can therefore lose report
state and duplicate reports. And The error_reported boolean only tell
us that some lower-level path has already emitted an error. Consequently
a report can incorrectly suppress a separate report for a later rollback
or resotre failure, even though that failure represents an independant
filesystem integrity problem.

Instead of carrying error_reported, would it be simpler to report each
error at its detection point and let fanofify merge repeated error
events? or would there be any alternatives?

-- 
Thanks,
Hyunchul

  reply	other threads:[~2026-09-16  7:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  2:23 [PATCH v2 0/5] ntfs: report filesystem errors through fsnotify Baolin Liu
2026-09-16  2:23 ` [PATCH v2 1/5] ntfs: report allocation metadata errors to fsnotify Baolin Liu
2026-09-16  2:23 ` [PATCH v2 2/5] ntfs: report attribute " Baolin Liu
2026-09-16  7:38   ` Hyunchul Lee [this message]
2026-09-17  4:21     ` liubaolin
2026-09-16  2:23 ` [PATCH v2 3/5] ntfs: report inode metadata " Baolin Liu
2026-09-16  2:23 ` [PATCH v2 4/5] ntfs: report MFT " Baolin Liu
2026-09-16  2:23 ` [PATCH v2 5/5] ntfs: report shutdown " Baolin Liu
2026-09-16  2:40 ` [PATCH v2 0/5] ntfs: report filesystem errors through fsnotify liubaolin

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=aqpHhxKx_xiSoZZQ@hyunchul-PC02 \
    --to=hyc.lee@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liubaolin12138@163.com \
    --cc=liubaolin@kylinos.cn \
    --cc=ntfs@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®