Skip to content

Commit

Permalink
ext4: use truncate_pagecache() in collapse range
Browse files Browse the repository at this point in the history
We should be using truncate_pagecache() instead of
truncate_pagecache_range() in the collapse range because we're
truncating page cache from offset to the end of file.
truncate_pagecache() also get rid of the private COWed pages from the
range because we're going to shift the end of the file.

Signed-off-by: Lukas Czerner <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
Lukas Czerner authored and tytso committed Apr 18, 2014
1 parent 50e02fd commit 694c793
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -5437,7 +5437,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
goto out_mutex;
}

truncate_pagecache_range(inode, offset, -1);
truncate_pagecache(inode, offset);

/* Wait for existing dio to complete */
ext4_inode_block_unlocked_dio(inode);
Expand Down

0 comments on commit 694c793

Please sign in to comment.