From 60038154b40e03fdfade1eb975f0305c4c887d5e Mon Sep 17 00:00:00 2001 From: Baolin Liu Date: Tue, 18 Aug 2026 16:27:40 +0800 Subject: [PATCH] ntfs: do not update ctime when setxattr fails ntfs_setxattr() updates ctime and marks the inode dirty even when the operation fails. A failed setxattr(2) must not change file metadata. Update ctime only on success. Fixes: fc053f05ca28 ("ntfs: add reparse and ea operations") Signed-off-by: Baolin Liu Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon --- fs/ntfs/ea.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ntfs/ea.c b/fs/ntfs/ea.c index fc6cec7ce130..fcba051b514a 100644 --- a/fs/ntfs/ea.c +++ b/fs/ntfs/ea.c @@ -881,8 +881,10 @@ static int ntfs_setxattr(const struct xattr_handler *handler, mutex_unlock(&ni->mrec_lock); out: - inode_set_ctime_current(inode); - mark_inode_dirty(inode); + if (!err) { + inode_set_ctime_current(inode); + mark_inode_dirty(inode); + } return err; }