xfs: extent shifting doesn't fully invalidate page cache
authorDave Chinner <dchinner@redhat.com>
Mon, 19 Nov 2018 21:31:09 +0000 (13:31 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:51:29 +0000 (08:51 +0100)
commit249279c677aff01d6c4eaa99c1fb0bb6f8edd3f9
treee00357eb95e71f1c39ba2fc3bb303c9dc1b2e537
parent5e28bbc7c8643c3d4b259e50b6b365b3a60db43c
xfs: extent shifting doesn't fully invalidate page cache

[ 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@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/xfs_bmap_util.c