mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 06:17:27 +02:00
ntfs: leave HasEA flag untouched on setxattr failure
In ntfs_set_ea(), the exit path unconditionally updates the HasEA
flag based on ea_info_qsize. When an error occurs before
ea_info_qsize is updated, NInoClearHasEA() hides existing on-disk
EAs until the inode is evicted.
Only update the flag on success.
Fixes: fc053f05ca ("ntfs: add reparse and ea operations")
Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
parent
67aded1da1
commit
ac727d86fb
10
fs/ntfs/ea.c
10
fs/ntfs/ea.c
|
|
@ -404,10 +404,12 @@ static int ntfs_set_ea(struct inode *inode, const char *name, size_t name_len,
|
|||
*packed_ea_size = p_ea_info->ea_length;
|
||||
mark_mft_record_dirty(ni);
|
||||
out:
|
||||
if (ea_info_qsize > 0)
|
||||
NInoSetHasEA(ni);
|
||||
else
|
||||
NInoClearHasEA(ni);
|
||||
if (!err) {
|
||||
if (ea_info_qsize > 0)
|
||||
NInoSetHasEA(ni);
|
||||
else
|
||||
NInoClearHasEA(ni);
|
||||
}
|
||||
|
||||
kvfree(ea_buf);
|
||||
kvfree(old_ea_buf);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user