Re: [PATCH 1/6] ntfs: mark the record dirtied by a resident write at iomap begin

From: Hyunchul Lee

Date: Thu Nov 26 2026 - 03:45:13 EST


Hi Hongling,

>
> + /*
> + * The record holding a resident attribute can be an extent record.
> + * Mark the record the lookup found dirty here, while the search
> + * context still points at it. The writeout of the record cannot
> + * overtake the inline copy: it is serialized by the mrec_lock held
> + * until iomap_end.
> + */
> + mark_mft_record_dirty(ctx->ntfs_ino);
> +

If the write fails before the data is copied into the resident
attribute, the MFT record is still marked dirty and may be written back
even if its contents have not changed.

> a = ctx->attr;
> /* The total length of the attribute value. */
> attr_len = le32_to_cpu(a->data.resident.value_length);
> --
> 2.25.1
>

--
Thanks,
Hyunchul