diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/inode.c | 6 | ||||
-rw-r--r-- | fs/ext4/page-io.c | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index eb4ddfeeeedc..d6e4f0e09a8c 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3643,12 +3643,6 @@ void ext4_truncate(struct inode *inode) | |||
3643 | return; | 3643 | return; |
3644 | } | 3644 | } |
3645 | 3645 | ||
3646 | /* | ||
3647 | * finish any pending end_io work so we won't run the risk of | ||
3648 | * converting any truncated blocks to initialized later | ||
3649 | */ | ||
3650 | ext4_flush_unwritten_io(inode); | ||
3651 | |||
3652 | if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) | 3646 | if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) |
3653 | credits = ext4_writepage_trans_blocks(inode); | 3647 | credits = ext4_writepage_trans_blocks(inode); |
3654 | else | 3648 | else |
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 755741c211a4..0f65561ab5a5 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -158,7 +158,14 @@ static void ext4_clear_io_unwritten_flag(ext4_io_end_t *io_end) | |||
158 | wake_up_all(ext4_ioend_wq(inode)); | 158 | wake_up_all(ext4_ioend_wq(inode)); |
159 | } | 159 | } |
160 | 160 | ||
161 | /* check a range of space and convert unwritten extents to written. */ | 161 | /* |
162 | * Check a range of space and convert unwritten extents to written. Note that | ||
163 | * we are protected from truncate touching same part of extent tree by the | ||
164 | * fact that truncate code waits for all DIO to finish (thus exclusion from | ||
165 | * direct IO is achieved) and also waits for PageWriteback bits. Thus we | ||
166 | * cannot get to ext4_ext_truncate() before all IOs overlapping that range are | ||
167 | * completed (happens from ext4_free_ioend()). | ||
168 | */ | ||
162 | static int ext4_end_io(ext4_io_end_t *io) | 169 | static int ext4_end_io(ext4_io_end_t *io) |
163 | { | 170 | { |
164 | struct inode *inode = io->inode; | 171 | struct inode *inode = io->inode; |