Commit 0bd454c0 authored by Tahsin Erdogan's avatar Tahsin Erdogan Committed by Theodore Ts'o

ext4: ext4_xattr_value_same() should return false for external data

ext4_xattr_value_same() is used as a quick optimization in case the new
xattr value is identical to the previous value. When xattr value is
stored in a xattr inode the check becomes expensive so it is better to
just assume that they are not equal.
Signed-off-by: default avatarTahsin Erdogan <tahsin@google.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 990461dd
...@@ -1426,6 +1426,9 @@ static int ext4_xattr_value_same(struct ext4_xattr_search *s, ...@@ -1426,6 +1426,9 @@ static int ext4_xattr_value_same(struct ext4_xattr_search *s,
{ {
void *value; void *value;
/* When e_value_inum is set the value is stored externally. */
if (s->here->e_value_inum)
return 0;
if (le32_to_cpu(s->here->e_value_size) != i->value_len) if (le32_to_cpu(s->here->e_value_size) != i->value_len)
return 0; return 0;
value = ((void *)s->base) + le16_to_cpu(s->here->e_value_offs); value = ((void *)s->base) + le16_to_cpu(s->here->e_value_offs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment