Re: [PATCH] fs/ntfs3: update ctime only on successful setxattr
From: Konstantin Komarov
Date: Mon Sep 14 2026 - 03:49:22 EST
On 6/26/26 11:49, Baolin Liu wrote:
From: Baolin Liu <liubaolin@xxxxxxxxxx>
ntfs_setxattr() updates ctime and marks the inode dirty even when the
xattr operation fails.
Do that only on success.
Fixes: 2d44667c306e ("fs/ntfs3: Update i_ctime when xattr is added")
Signed-off-by: Baolin Liu <liubaolin@xxxxxxxxxx>
---
fs/ntfs3/xattr.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index 9eeac0ab2b71..9743a63a152e 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -960,8 +960,10 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler,
NULL);
out:
- inode_set_ctime_current(inode);
- mark_inode_dirty(inode);
+ if (!err) {
+ inode_set_ctime_current(inode);
+ mark_inode_dirty(inode);
+ }
return err;
}
Hello,
Sorry for the delay.
Your patch is applied, thanks.
Regards,
Konstantin