]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: ensure post-EOF zeroing happens after zeroing part of a file
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 22 Jun 2018 06:26:58 +0000 (23:26 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sun, 24 Jun 2018 18:56:36 +0000 (11:56 -0700)
commite86c8ebdc9c48fead75db0992cee239d117ad911
tree53c14ed955b01e8966afdf4c2ee41f76d2b73427
parent09c6db55fdb727c8cbe870f5b6642bacb21f9a94
xfs: ensure post-EOF zeroing happens after zeroing part of a file

If a user asks us to zero_range part of a file, the end of the range is
EOF, and not aligned to a page boundary, invoke writeback of the EOF
page to ensure that the post-EOF part of the page is zeroed.  This
ensures that we don't expose stale memory contents via mmap, if in a
clumsy manner.

Found by running generic/127 when it runs zero_range and mapread at EOF
one after the other.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
fs/xfs/xfs_bmap_util.c