ntfs: sync attribute inode size after resize

Internal attribute truncation bypasses truncate_setsize(), so successful
resizes must update the attribute inode's i_size. Restrict the update to
attribute inodes to keep KEEP_SIZE fallocate from changing a file's i_size.

Fixes: 495e90fa33 ("ntfs: update attrib operations")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Namjae Jeon 2026-10-07 16:43:28 +09:00
parent 8506a8031e
commit 3e38885ff6

View File

@ -5187,6 +5187,8 @@ int ntfs_attr_truncate_i_locked(struct ntfs_inode *ni, const s64 newsize,
ni, newsize, locked_ni, false);
} else
err = ntfs_resident_attr_resize(ni, newsize, 0, holes);
if (!err && NInoAttr(ni))
i_size_write(VFS_I(ni), newsize);
ntfs_debug("Return status %d\n", err);
return err;
}