From: Maxim Patlasov Date: Thu, 20 Feb 2014 21:58:05 +0000 (-0500) Subject: ext4: avoid exposure of stale data in ext4_punch_hole() X-Git-Tag: v3.15-rc1~91^2~29 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e251f9bca99c0f219eff9c76034476c2b17d3dba;p=pandora-kernel.git ext4: avoid exposure of stale data in ext4_punch_hole() While handling punch-hole fallocate, it's useless to truncate page cache before removing the range from extent tree (or block map in indirect case) because page cache can be re-populated (by read-ahead or read(2) or mmap-ed read) immediately after truncating page cache, but before updating extent tree (or block map). In that case the user will see stale data even after fallocate is completed. Until the problem of data corruption resulting from pages backed by already freed blocks is fully resolved, the simple thing we can do now is to add another truncation of pagecache after punch hole is done. Signed-off-by: Maxim Patlasov Signed-off-by: "Theodore Ts'o" Reviewed-by: Jan Kara --- Reading git-diff-tree failed