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

From: Namjae Jeon

Date: Tue Nov 10 2026 - 21:12:07 EST


> @@ -4895,8 +4922,19 @@ static int ntfs_resident_attr_resize(struct ntfs_inode *attr_ni, const s64 newsi
> /* There is not enough space in the mft record to perform the resize. */
>
> /* Make the attribute non-resident if possible. */
> - err = ntfs_attr_make_non_resident(attr_ni,
> - le32_to_cpu(ctx->attr->data.resident.value_length));
> + err = __ntfs_attr_make_non_resident(attr_ni,
> + le32_to_cpu(ctx->attr->data.resident.value_length), true);
> + /*
> + * A reader holding folio 0 waits for mrec_lock, which we hold. Do not
> + * wait for it and do not look for room elsewhere either: the reader
> + * keeps the folio until we drop the lock, so the attribute can neither
> + * be converted nor written without waiting for it, and the loop below
> + * would only convert other attributes for nothing.
> + */
> + if (err == -EAGAIN) {
> + err = -ENOSPC;
Please explain why -EAGAIN should be changed to -ENOSPC.
Thanks.
> + goto put_err_out;
> + }