diff options
author | Ross Zwisler <ross.zwisler@linux.intel.com> | 2018-07-29 17:00:22 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-07-29 17:00:22 -0400 |
commit | 430657b6be896db57d974375cc499ca212c7f01d (patch) | |
tree | ba4489c4000ac7946de998f9f6a5cd2a3834d283 /fs/ext4/truncate.h | |
parent | cdbf8897cb09b7baf2b8a7e78051a35a872b01d5 (diff) | |
download | linux-430657b6be896db57d974375cc499ca212c7f01d.tar.gz linux-430657b6be896db57d974375cc499ca212c7f01d.tar.bz2 linux-430657b6be896db57d974375cc499ca212c7f01d.zip |
ext4: handle layout changes to pinned DAX mappings
Follow the lead of xfs_break_dax_layouts() and add synchronization between
operations in ext4 which remove blocks from an inode (hole punch, truncate
down, etc.) and pages which are pinned due to DAX DMA operations.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Diffstat (limited to 'fs/ext4/truncate.h')
-rw-r--r-- | fs/ext4/truncate.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/truncate.h b/fs/ext4/truncate.h index 0cb13badf473..bcbe3668c1d4 100644 --- a/fs/ext4/truncate.h +++ b/fs/ext4/truncate.h @@ -11,6 +11,10 @@ */ static inline void ext4_truncate_failed_write(struct inode *inode) { + /* + * We don't need to call ext4_break_layouts() because the blocks we + * are truncating were never visible to userspace. + */ down_write(&EXT4_I(inode)->i_mmap_sem); truncate_inode_pages(inode->i_mapping, inode->i_size); ext4_truncate(inode); |