mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
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: fc053f05ca ("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>
This commit is contained in:
parent
cc9d09fef7
commit
60038154b4
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user