ntfs: keep the EA presence flag after creating the first entry

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@kylinos.cn>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Baolin Liu 2026-09-23 14:02:37 +08:00 committed by Namjae Jeon
parent f8f026e3ab
commit b3dd259d83

View File

@ -403,6 +403,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) {