[PATCH v2 01/10] ntfs: keep the EA presence flag after creating the first entry
From: Baolin Liu
Date: Sun Sep 20 2026 - 04:32:20 EST
From: Baolin Liu <liubaolin@xxxxxxxxxx>
The successful EA update path tests ea_info_qsize when updating
NInoHasEA, but this size excludes the appended entry. Creating the first
EA, or replacing the only entry, can therefore clear the cached presence
flag despite a successful update. Reads then return ENODATA until reload.
Include the appended entry in the size used for the presence test.
Signed-off-by: Baolin Liu <liubaolin@xxxxxxxxxx>
---
fs/ntfs/ea.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ntfs/ea.c b/fs/ntfs/ea.c
index b4fcfbe2da4c..bb97df3045a0 100644
--- a/fs/ntfs/ea.c
+++ b/fs/ntfs/ea.c
@@ -402,6 +402,7 @@ static int ntfs_set_ea(struct inode *inode, const char *name, size_t name_len,
if (packed_ea_size)
*packed_ea_size = p_ea_info->ea_length;
+ ea_info_qsize += new_ea_size;
mark_mft_record_dirty(ni);
out:
if (!err) {
--
2.51.0