diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-10-09 16:42:59 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-10-21 09:05:19 -0700 |
commit | 25219dbfa734e848fe4da84143f972d0301bb7c6 (patch) | |
tree | 490288634e81fba1d44c642d5d6fe9b46dee3995 /lib/iommu-helper.c | |
parent | 894645546bb12ce008dcba0f68834d270fcd1dde (diff) | |
download | linux-25219dbfa734e848fe4da84143f972d0301bb7c6.tar.gz linux-25219dbfa734e848fe4da84143f972d0301bb7c6.tar.bz2 linux-25219dbfa734e848fe4da84143f972d0301bb7c6.zip |
xfs: fix fallocate functions when rtextsize is larger than 1
In commit fe341eb151ec, I forgot that xfs_free_file_space isn't strictly
a "remove mapped blocks" function. It is actually a function to zero
file space by punching out the middle and writing zeroes to the
unaligned ends of the specified range. Therefore, putting a rtextsize
alignment check in that function is wrong because that breaks unaligned
ZERO_RANGE on the realtime volume.
Furthermore, xfs_file_fallocate already has alignment checks for the
functions require the file range to be aligned to the size of a
fundamental allocation unit (which is 1 FSB on the data volume and 1 rt
extent on the realtime volume). Create a new helper to check fallocate
arguments against the realtiem allocation unit size, fix the fallocate
frontend to use it, fix free_file_space to delete the correct range, and
remove a now redundant check from insert_file_space.
NOTE: The realtime extent size is not required to be a power of two!
Fixes: fe341eb151ec ("xfs: ensure that fpunch, fcollapse, and finsert operations are aligned to rt extent size")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Diffstat (limited to 'lib/iommu-helper.c')
0 files changed, 0 insertions, 0 deletions