1 ext4: never move the system.data xattr out of the inode body
3 When expanding the extra isize space, we must never move the
4 system.data xattr out of the inode body. For performance reasons, it
5 doesn't make any sense, and the inline data implementation assumes
6 that system.data xattr is never in the external xattr block.
8 https://bugzilla.kernel.org/show_bug.cgi?id=200005
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
12 index 0263692979ec..72377b77fbd7 100644
15 @@ -2657,6 +2657,11 @@ static int ext4_xattr_make_inode_space(handle_t *handle, struct inode *inode,
16 last = IFIRST(header);
17 /* Find the entry best suited to be pushed into EA block */
18 for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) {
19 + /* never move system.data out of the inode */
20 + if ((last->e_name_len == 4) &&
21 + (last->e_name_index == EXT4_XATTR_INDEX_SYSTEM) &&
22 + !memcmp(last->e_name, "data", 4))
24 total_size = EXT4_XATTR_LEN(last->e_name_len);
25 if (!last->e_value_inum)
26 total_size += EXT4_XATTR_SIZE(