Darrick J. Wong 25219dbfa7 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>
2020-10-21 09:05:19 -07:00
..
2020-09-01 18:36:45 -07:00
2020-08-30 11:38:21 -07:00
\n
2020-08-28 10:57:14 -07:00
2020-08-11 14:34:17 -07:00
2020-08-25 18:01:36 -07:00
\n
2020-08-06 19:28:26 -07:00
2020-06-05 14:05:57 -07:00
2020-08-11 17:42:24 +09:00
2020-08-23 17:36:59 -05:00
2020-07-27 14:29:23 -04:00
2020-08-03 13:01:22 -07:00
2020-08-23 17:36:59 -05:00
2020-08-04 21:02:38 -04:00
2020-06-05 16:26:36 -07:00
2020-09-06 12:10:27 -07:00
2020-07-31 08:16:01 +02:00
2020-08-07 11:33:24 -07:00
2020-07-31 08:17:51 +02:00
2020-05-14 16:44:24 +02:00
2020-08-12 10:58:01 -07:00
2020-07-31 08:16:00 +02:00
2020-06-02 19:45:12 -07:00
2020-06-09 15:40:50 -07:00
2020-07-31 08:16:01 +02:00