Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1672059 > unrolled thread

[PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data

Started byTahsin Erdogan <tahsin@google.com>
First post2017-06-21 23:30 +0200
Last post2017-06-22 04:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data Tahsin Erdogan <tahsin@google.com> - 2017-06-21 23:30 +0200
    Re: [PATCH 13/32] ext4: ext4_xattr_value_same() should return false  for external data Theodore Ts'o <tytso@mit.edu> - 2017-06-22 04:10 +0200

#1672059 — [PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data

FromTahsin Erdogan <tahsin@google.com>
Date2017-06-21 23:30 +0200
Subject[PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data
Message-ID<tUVmk-3od-57@gated-at.bofh.it>
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: Tahsin Erdogan <tahsin@google.com>
---
 fs/ext4/xattr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 4dd8be16d175..681a9b5eefd8 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1428,6 +1428,9 @@ static int ext4_xattr_value_same(struct ext4_xattr_search *s,
 {
 	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)
 		return 0;
 	value = ((void *)s->base) + le16_to_cpu(s->here->e_value_offs);
-- 
2.13.1.611.g7e3b11ae1-goog

[toc] | [next] | [standalone]


#1672247 — Re: [PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data

FromTheodore Ts'o <tytso@mit.edu>
Date2017-06-22 04:10 +0200
SubjectRe: [PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data
Message-ID<tUZJf-6uJ-7@gated-at.bofh.it>
In reply to#1672059
On Wed, Jun 21, 2017 at 02:21:23PM -0700, Tahsin Erdogan wrote:
> 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: Tahsin Erdogan <tahsin@google.com>

Thanks, added to the ext4 patch queue.

					- Ted

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web