From 6a06ca628d41b239b1203b40fb92ecdcc5e3a467 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Tue, 4 Jun 2013 14:30:00 -0400 Subject: [PATCH] --- yaml --- r: 377601 b: refs/heads/master c: a115f749c14ee94e8b7bdbd203a5afdb1659156b h: refs/heads/master i: 377599: 6bf9df42cc4d2ac52d78a067ba15a817e3c94d8b v: v3 --- [refs] | 2 +- trunk/fs/ext4/inode.c | 6 ------ trunk/fs/ext4/page-io.c | 9 ++++++++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 65efacbb3dcf..1caf66e6853b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e83403959fddb6d90e8c5e54bbce3110d0c82165 +refs/heads/master: a115f749c14ee94e8b7bdbd203a5afdb1659156b diff --git a/trunk/fs/ext4/inode.c b/trunk/fs/ext4/inode.c index eb4ddfeeeedc..d6e4f0e09a8c 100644 --- a/trunk/fs/ext4/inode.c +++ b/trunk/fs/ext4/inode.c @@ -3643,12 +3643,6 @@ void ext4_truncate(struct inode *inode) return; } - /* - * finish any pending end_io work so we won't run the risk of - * converting any truncated blocks to initialized later - */ - ext4_flush_unwritten_io(inode); - if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) credits = ext4_writepage_trans_blocks(inode); else diff --git a/trunk/fs/ext4/page-io.c b/trunk/fs/ext4/page-io.c index 755741c211a4..0f65561ab5a5 100644 --- a/trunk/fs/ext4/page-io.c +++ b/trunk/fs/ext4/page-io.c @@ -158,7 +158,14 @@ static void ext4_clear_io_unwritten_flag(ext4_io_end_t *io_end) wake_up_all(ext4_ioend_wq(inode)); } -/* check a range of space and convert unwritten extents to written. */ +/* + * Check a range of space and convert unwritten extents to written. Note that + * we are protected from truncate touching same part of extent tree by the + * fact that truncate code waits for all DIO to finish (thus exclusion from + * direct IO is achieved) and also waits for PageWriteback bits. Thus we + * cannot get to ext4_ext_truncate() before all IOs overlapping that range are + * completed (happens from ext4_free_ioend()). + */ static int ext4_end_io(ext4_io_end_t *io) { struct inode *inode = io->inode;