diff options
author | Jan Kara <jack@suse.cz> | 2016-08-11 11:50:30 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-08-11 11:50:30 -0400 |
commit | d0141191a20289f8955c1e03dad08e42e6f71ca9 (patch) | |
tree | 07f9a745bb20947ff3625d2a9ca71d7ae21dc492 /Documentation | |
parent | 829fa70dddadf9dd041d62b82cd7cea63943899d (diff) |
ext4: fix xattr shifting when expanding inodes
The code in ext4_expand_extra_isize_ea() treated new_extra_isize
argument sometimes as the desired target i_extra_isize and sometimes as
the amount by which we need to grow current i_extra_isize. These happen
to coincide when i_extra_isize is 0 which used to be the common case and
so nobody noticed this until recently when we added i_projid to the
inode and so i_extra_isize now needs to grow from 28 to 32 bytes.
The result of these bugs was that we sometimes unnecessarily decided to
move xattrs out of inode even if there was enough space and we often
ended up corrupting in-inode xattrs because arguments to
ext4_xattr_shift_entries() were just wrong. This could demonstrate
itself as BUG_ON in ext4_xattr_shift_entries() triggering.
Fix the problem by introducing new isize_diff variable and use it where
appropriate.
CC: stable@vger.kernel.org # 4.4.x
Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions