OSDN Git Service

libext2fs: zero block contents past EOF when setting size
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Dec 2013 18:31:35 +0000 (13:31 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 12 Dec 2013 18:32:25 +0000 (13:32 -0500)
commit299cc61755f72311df002cc99dae13f469e0a198
treeb3f923a33b73d8a8934eec56e5dcc315bd5c8908
parent4b58df1a53f517d700d921714610d1cec524dc92
libext2fs: zero block contents past EOF when setting size

When we set the file size, find the block containing EOF, and zero
everything in that block past EOF so that we can't return stale data
if we ever use fallocate or truncate to lengthen the file.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/fileio.c