projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08dc390
)
ext4: keep existing extra fields when inode expands
author
Konstantin Khlebnikov
<khlebnikov@yandex-team.ru>
Mon, 22 May 2017 02:36:23 +0000
(22:36 -0400)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 14 Jun 2017 11:16:22 +0000
(13:16 +0200)
commit
887a9730614727c4fff7cb756711b190593fc1df
upstream.
ext4_expand_extra_isize() should clear only space between old and new
size.
Fixes: 6dd4ee7cab7e # v2.6.23
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inode.c
patch
|
blob
|
history
diff --git
a/fs/ext4/inode.c
b/fs/ext4/inode.c
index ccae64dad40c9740469021da944add0053b39f80..27e34fbb0aa53f19b68896304fb49d0282c0de95 100644
(file)
--- a/
fs/ext4/inode.c
+++ b/
fs/ext4/inode.c
@@
-5162,8
+5162,9
@@
static int ext4_expand_extra_isize(struct inode *inode,
/* No extended attributes present */
if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR) ||
header->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC)) {
- memset((void *)raw_inode + EXT4_GOOD_OLD_INODE_SIZE, 0,
- new_extra_isize);
+ memset((void *)raw_inode + EXT4_GOOD_OLD_INODE_SIZE +
+ EXT4_I(inode)->i_extra_isize, 0,
+ new_extra_isize - EXT4_I(inode)->i_extra_isize);
EXT4_I(inode)->i_extra_isize = new_extra_isize;
return 0;
}