1 ext4: truncate_inode_pages() in orphan cleanup path
3 From: Lukas Czerner <lczerner@redhat.com>
5 Currently we do not tell mm to zero out tail of the page before truncate
6 in orphan_cleanup(). This is ok, because the page should not be
7 uptodate, however this may eventually change and I might cause problems.
9 Call truncate_inode_pages() as precautionary measure. Thanks Jan Kara
10 for pointing this out.
12 Signed-off-by: Lukas Czerner <lczerner@redhat.com>
13 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
16 index 94cc84d..c468560 100644
19 @@ -2170,6 +2170,7 @@ static void ext4_orphan_cleanup(struct super_block *sb,
20 jbd_debug(2, "truncating inode %lu to %lld bytes\n",
21 inode->i_ino, inode->i_size);
22 mutex_lock(&inode->i_mutex);
23 + truncate_inode_pages(inode->i_mapping, inode->i_size);
25 mutex_unlock(&inode->i_mutex);