Skip to contentSkip to conversation

NTFS rename fails with "Failed to add AT_INDEX_ALLOCATION" on Linux 7.1 new ntfs driver

BUG Namjae Jeon 1 participant 1 message Aug 10 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Namjae Jeon

author maintainer
#1 lore raw
Quoted 4 lines

Summary:
========
On Linux 7.1 with the new in-kernel NTFS driver (NTFSPlus/NTFS_FS), rename() operations fail when the target directory's index inode MFT

record

Quoted 1 line

is full. This manifests as "Disk write failure" in applications like

Steam.
Can you check if the attached patch fixes this issue? Thanks!

From ebca5803af989a2a7d5da4d734915d020ba69589 Mon Sep 17 00:00:00 2001
From: Namjae Jeon <[email protected]>
Date: Mon, 10 Aug 2026 23:23:17 +0900
Subject: [PATCH] ntfs: allow index root relocation

Allow a resident attribute record to move to an extent MFT record when the base record needs room for an attribute list. Retry the root conversion after creating the list, but do not relocate a root that is already external.

Roll the root back to the base record if persisting the attribute list fails, and free extent MFT records left empty by relocation or rollback. Also preserve bitmap allocation errors in index operations.

---
 fs/ntfs/attrib.c |  7 +++-
 fs/ntfs/index.c  | 85 +++++++++++++++++++++++++++++++++++++++---------
 fs/ntfs/inode.c  | 64 ++++++++++++++++++++++++++++++++++--
 fs/ntfs/inode.h  |  1 +
 4 files changed, 137 insertions(+), 20 deletions(-)
fs/ntfs/attrib.c +6 -1
index c62c8ca8b987..990c3937a551 100644
@@ -3558,8 +3558,13 @@ int ntfs_attr_record_move_away(struct ntfs_attr_search_ctx *ctx, int extra)
 	unmap_mft_record(ni);
 
 	err = ntfs_attr_record_move_to(ctx, ni);
-	if (err)
+	if (err) {
 		ntfs_error(sb, "Couldn't move attribute to MFT record");
+		if (ntfs_mft_record_free(base_ni->vol, ni))
+			ntfs_error(sb, "Couldn't free empty MFT record");
+		else
+			ntfs_inode_close(ni);
+	}
 
 	return err;
 }
fs/ntfs/index.c +69 -16

147 lines not on this page · raw message

fs/ntfs/inode.c +61 -3

106 lines not on this page · raw message

fs/ntfs/inode.h +1 -0
index c6d065aaecd5..aee1c1fdb609 100644
@@ -338,6 +338,7 @@ int ntfs_get_block_mft_record(struct ntfs_inode *mft_ni, struct ntfs_inode *ni);
 int __ntfs_write_inode(struct inode *vi, int sync);
 int ntfs_inode_attach_all_extents(struct ntfs_inode *ni);
 int ntfs_inode_add_attrlist(struct ntfs_inode *ni);
+int ntfs_inode_free_empty_extents(struct ntfs_inode *ni);
 void ntfs_destroy_ext_inode(struct ntfs_inode *ni);
 int ntfs_inode_free_space(struct ntfs_inode *ni, int size);
 s64 ntfs_inode_attr_pread(struct inode *vi, s64 pos, s64 count, u8 *buf);
Signature · 1 line
2.25.1