mbox series

[0/2] xfs: fallocate RT flush unmap range fixes

Message ID 20240509104057.1197846-1-john.g.garry@oracle.com (mailing list archive)
Headers show
Series xfs: fallocate RT flush unmap range fixes | expand

Message

John Garry May 9, 2024, 10:40 a.m. UTC
As mentioned by Dave Chinner at [0], xfs_flush_unmap_range() and
xfs_prepare_shift() should consider RT extents in the flush unmap range,
and need to be fixed.

I don't want to add such changes to that series, so I am sending
separately.

About the change in xfs_prepare_shift(), that function is only called
from xfs_insert_file_space() and xfs_collapse_file_space(). Those
functions only permit RT extent-aligned calls in xfs_is_falloc_aligned(),
so in practice I don't think that this change would affect
xfs_prepare_shift(). And xfs_prepare_shift() calls
xfs_flush_unmap_range(), which is being fixed up anyway.

[0] https://lore.kernel.org/linux-xfs/ZjGSiOt21g5JCOhf@dread.disaster.area/

Changes since RFC:
- Use roundup() and rounddown() (Darrick)
- Change xfs_prepare_shift() comment (Darrick)
- Add Christoph's RB tags - I think ok, even though code has changed
  since RFC

John Garry (2):
  xfs: Fix xfs_flush_unmap_range() range for RT
  xfs: Fix xfs_prepare_shift() range for RT

 fs/xfs/xfs_bmap_util.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

Comments

Darrick J. Wong May 9, 2024, 2:35 p.m. UTC | #1
On Thu, May 09, 2024 at 10:40:55AM +0000, John Garry wrote:
> As mentioned by Dave Chinner at [0], xfs_flush_unmap_range() and
> xfs_prepare_shift() should consider RT extents in the flush unmap range,
> and need to be fixed.
> 
> I don't want to add such changes to that series, so I am sending
> separately.
> 
> About the change in xfs_prepare_shift(), that function is only called
> from xfs_insert_file_space() and xfs_collapse_file_space(). Those
> functions only permit RT extent-aligned calls in xfs_is_falloc_aligned(),
> so in practice I don't think that this change would affect
> xfs_prepare_shift(). And xfs_prepare_shift() calls
> xfs_flush_unmap_range(), which is being fixed up anyway.
> 
> [0] https://lore.kernel.org/linux-xfs/ZjGSiOt21g5JCOhf@dread.disaster.area/

Looks good to me,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> 
> Changes since RFC:
> - Use roundup() and rounddown() (Darrick)
> - Change xfs_prepare_shift() comment (Darrick)
> - Add Christoph's RB tags - I think ok, even though code has changed
>   since RFC
> 
> John Garry (2):
>   xfs: Fix xfs_flush_unmap_range() range for RT
>   xfs: Fix xfs_prepare_shift() range for RT
> 
>  fs/xfs/xfs_bmap_util.c | 22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)
> 
> -- 
> 2.31.1
> 
>