summaryrefslogtreecommitdiff
path: root/fs/ntfs
diff options
context:
space:
mode:
authorBaolin Liu <liubaolin@kylinos.cn>2026-08-18 16:27:40 +0800
committerNamjae Jeon <linkinjeon@kernel.org>2026-08-19 19:12:02 +0900
commit60038154b40e03fdfade1eb975f0305c4c887d5e (patch)
tree6dc868a348c98e85d72165a345008cf1c7c6ca85 /fs/ntfs
parentcc9d09fef78410bcd37ac05168cbd5f6dd75d3d2 (diff)
downloadlinux-60038154b40e03fdfade1eb975f0305c4c887d5e.tar.gz
linux-60038154b40e03fdfade1eb975f0305c4c887d5e.zip
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 <liubaolin@kylinos.cn> Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'fs/ntfs')
-rw-r--r--fs/ntfs/ea.c6
1 files 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 @@ set_fattr:
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;
}