Re: [PATCH v2 2/5] ntfs: report attribute errors to fsnotify
From: Hyunchul Lee
Date: Wed Sep 16 2026 - 03:52:34 EST
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