ntfs: do not update ctime when setxattr fails
Subsystems (2)
PATCH 1/1 ntfs: do not update ctime when setxattr fails
From: Baolin Liu <[email protected]>
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.
--- fs/ntfs/ea.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/ntfs/ea.c +4 -2
@@ -768,8 +768,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; }
Signature · 1 line
2.51.0
Hi Baolin,
2026년 8월 18일 (화) 오후 5:28, Baolin Liu <[email protected]>님이 작성:
Quoted 11 lines
From: Baolin Liu <[email protected]>
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 <[email protected]>
Looks good to me.
Signature · 2 lines
Thanks, Hyunchul
Quoted 11 lines · Baolin Liu
From: Baolin Liu <[email protected]>
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 <[email protected]>
Applied it to #ntfs-next.
Thanks!