diff options
| author | 2017-06-21 21:36:51 -0400 | |
|---|---|---|
| committer | 2017-06-21 21:36:51 -0400 | |
| commit | ddfa17e4adc4bd19c32216aaa6250dc38b0579df (patch) | |
| tree | dd98d6850e32b6998c97b44d157f0a8d2ce5dc40 /fs/ext4/extents.c | |
| parent | ext4: ea_inode owner should be the same as the inode owner (diff) | |
| download | wireguard-linux-ddfa17e4adc4bd19c32216aaa6250dc38b0579df.tar.xz wireguard-linux-ddfa17e4adc4bd19c32216aaa6250dc38b0579df.zip | |
ext4: call journal revoke when freeing ea_inode blocks
ea_inode contents are treated as metadata, that's why it is journaled
during initial writes. Failing to call revoke during freeing could cause
user data to be overwritten with original ea_inode contents during journal
replay.
Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to '')
| -rw-r--r-- | fs/ext4/extents.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 3e36508610b7..e0a8425ff74d 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2488,7 +2488,8 @@ int ext4_ext_index_trans_blocks(struct inode *inode, int extents) static inline int get_default_free_blocks_flags(struct inode *inode) { - if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) + if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode) || + ext4_test_inode_flag(inode, EXT4_INODE_EA_INODE)) return EXT4_FREE_BLOCKS_METADATA | EXT4_FREE_BLOCKS_FORGET; else if (ext4_should_journal_data(inode)) return EXT4_FREE_BLOCKS_FORGET; |
