diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-01-03 00:20:13 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-01-14 19:02:52 +0300 |
commit | 4bbb04abb4ee2e1f7d65e52557ba1c4038ea43ed (patch) | |
tree | 8602a1639d3b6874961f5547b434c6ec6ce1ee8d /scripts/gdb/linux/utils.py | |
parent | a5084865524dee1fe8ea1fee17c60b4369ad4f5e (diff) | |
download | linux-4bbb04abb4ee2e1f7d65e52557ba1c4038ea43ed.tar.xz |
xfs: truncate should remove all blocks, not just to the end of the page cache
xfs_itruncate_extents_flags() is supposed to unmap every block in a file
from EOF onwards. Oddly, it uses s_maxbytes as the upper limit to the
bunmapi range, even though s_maxbytes reflects the highest offset the
pagecache can support, not the highest offset that XFS supports.
The result of this confusion is that if you create a 20T file on a
64-bit machine, mount the filesystem on a 32-bit machine, and remove the
file, we leak everything above 16T. Fix this by capping the bunmapi
request at the maximum possible block offset, not s_maxbytes.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions