On Wed, Dec 11, 2019 at 04:03:52PM +0100, Greg Kroah-Hartman wrote: > From: Dave Chinner <dchinner@xxxxxxxxxx> > > [ Upstream commit 7f9f71be84bcab368e58020a42f6d0dd97adf0ce ] > > The extent shifting code uses a flush and invalidate mechainsm prior > to shifting extents around. This is similar to what > xfs_free_file_space() does, but it doesn't take into account things > like page cache vs block size differences, and it will fail if there > is a page that it currently busy. > > xfs_flush_unmap_range() handles all of these cases, so just convert > xfs_prepare_shift() to us that mechanism rather than having it's own > special sauce. > > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx> > Reviewed-by: Christoph Hellwig <hch@xxxxxx> > Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> This commit also required following commit: commit 1749d1ea89bdf3181328b7d846e609d5a0e53e50 Author: Brian Foster <bfoster@xxxxxxxxxx> Date: Fri Apr 26 07:30:24 2019 -0700 xfs: add missing error check in xfs_prepare_shift() xfs_prepare_shift() fails to check the error return from xfs_flush_unmap_range(). If the latter fails, that could lead to an insert/collapse range operation over a delalloc range, which is not supported. Add an error check and return appropriately. This is reproduced rarely by generic/475. Fixes: 7f9f71be84bc ("xfs: extent shifting doesn't fully invalidate page cache") Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx> Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Reviewed-by: Allison Collins <allison.henderson@xxxxxxxxxx> Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx> Best regards, Nobuhirio