Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1672063 > unrolled thread
| Started by | Tahsin Erdogan <tahsin@google.com> |
|---|---|
| First post | 2017-06-21 23:30 +0200 |
| Last post | 2017-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.
[PATCH 14/32] ext4: fix ext4_xattr_make_inode_space() value size calculation Tahsin Erdogan <tahsin@google.com> - 2017-06-21 23:30 +0200
Re: [PATCH 14/32] ext4: fix ext4_xattr_make_inode_space() value size calculation Theodore Ts'o <tytso@mit.edu> - 2017-06-22 04:10 +0200
| From | Tahsin Erdogan <tahsin@google.com> |
|---|---|
| Date | 2017-06-21 23:30 +0200 |
| Subject | [PATCH 14/32] ext4: fix ext4_xattr_make_inode_space() value size calculation |
| Message-ID | <tUVmk-3od-59@gated-at.bofh.it> |
ext4_xattr_make_inode_space() is interested in calculating the inline
space used in an inode. When a xattr entry refers to an external inode
the value size indicates the external inode size, not the value size in
the inline area. Change the function to take this into account.
Signed-off-by: Tahsin Erdogan <tahsin@google.com>
---
fs/ext4/xattr.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 681a9b5eefd8..6a6bee246873 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1747,9 +1747,10 @@ static int ext4_xattr_make_inode_space(handle_t *handle, struct inode *inode,
last = IFIRST(header);
/* Find the entry best suited to be pushed into EA block */
for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) {
- total_size =
- EXT4_XATTR_SIZE(le32_to_cpu(last->e_value_size)) +
- EXT4_XATTR_LEN(last->e_name_len);
+ total_size = EXT4_XATTR_LEN(last->e_name_len);
+ if (!last->e_value_inum)
+ total_size += EXT4_XATTR_SIZE(
+ le32_to_cpu(last->e_value_size));
if (total_size <= bfree &&
total_size < min_total_size) {
if (total_size + ifree < isize_diff) {
@@ -1768,8 +1769,10 @@ static int ext4_xattr_make_inode_space(handle_t *handle, struct inode *inode,
}
entry_size = EXT4_XATTR_LEN(entry->e_name_len);
- total_size = entry_size +
- EXT4_XATTR_SIZE(le32_to_cpu(entry->e_value_size));
+ total_size = entry_size;
+ if (!entry->e_value_inum)
+ total_size += EXT4_XATTR_SIZE(
+ le32_to_cpu(entry->e_value_size));
error = ext4_xattr_move_to_block(handle, inode, raw_inode,
entry);
if (error)
--
2.13.1.611.g7e3b11ae1-goog
[toc] | [next] | [standalone]
| From | Theodore Ts'o <tytso@mit.edu> |
|---|---|
| Date | 2017-06-22 04:10 +0200 |
| Subject | Re: [PATCH 14/32] ext4: fix ext4_xattr_make_inode_space() value size calculation |
| Message-ID | <tUZJf-6uJ-13@gated-at.bofh.it> |
| In reply to | #1672063 |
On Wed, Jun 21, 2017 at 02:21:24PM -0700, Tahsin Erdogan wrote: > ext4_xattr_make_inode_space() is interested in calculating the inline > space used in an inode. When a xattr entry refers to an external inode > the value size indicates the external inode size, not the value size in > the inline area. Change the function to take this into account. > > Signed-off-by: Tahsin Erdogan <tahsin@google.com> Thanks, applued. - Ted
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web