ntfs: propagate EA write and truncate errors

ntfs_write_ea() replaces negative write errors with EIO and ignores
errors when shrinking the attribute after writing a shorter list. This
can report success even though the final resize failed.

Preserve negative write errors, use EIO for short writes, and return
truncate failures to the caller.

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:39 +08:00 committed by Namjae Jeon
parent 7973cd834d
commit 2c0f29069e

View File

@ -32,7 +32,7 @@ static int ntfs_write_ea(struct ntfs_inode *ni, __le32 type, char *value, s64 ea
written = ntfs_inode_attr_pwrite(ea_vi, ea_off, ea_size, value, false);
if (written != ea_size)
err = -EIO;
err = written < 0 ? written : -EIO;
else {
struct ntfs_inode *ea_ni = NTFS_I(ea_vi);