Re: [PATCH v8] ntfs: convert a named $DATA stream safely when making room in a record

From: Namjae Jeon

Date: Thu Nov 12 2026 - 23:49:52 EST


On Thu, Nov 12, 2026 at 4:41 PM Wahid Khan <wahidzk0091@xxxxxxxxx> wrote:
>
> Hi Namjae,
>
> -EAGAIN must not leave ntfs_resident_attr_resize(). The callers return
> it as is, so a normal blocking write() or setxattr() would get EAGAIN
> for a "would block" that never was, and index.c already uses -EAGAIN
> internally as its "redo the insert" code (ntfs_ib_insert() ->
> resplit), so a stray one from ntfs_attr_truncate() could be taken for
> that.
>
> -ENOSPC is what this function already returns when the attribute does
> not fit and cannot be made non-resident, so callers already pass it up
> as a normal error.
> It is not exactly true here, it is a short lived "busy" and not a full
> record, but there is no way to wait for folio 0 at that point without
> the deadlock (the reader holds it and waits for mrec_lock), and no
> errno fits better. I can use -EBUSY or add a comment saying so if you
> prefer.
Okay, please use it here.
Thanks.