]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: don't free rt blocks when we're doing a REMAP bunmapi call
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 21 Sep 2020 16:15:08 +0000 (09:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:08:42 +0000 (11:08 +0100)
commit451a7c74c23b2ec42410ca5a7110c1a85ebae688
treebb89e106198ab5d6ab3c7e6a2fc24ba28e5e9817
parent0a2cb1eae0a70acf701600b510de04c55404bb31
xfs: don't free rt blocks when we're doing a REMAP bunmapi call

[ Upstream commit 8df0fa39bdd86ca81a8d706a6ed9d33cc65ca625 ]

When callers pass XFS_BMAPI_REMAP into xfs_bunmapi, they want the extent
to be unmapped from the given file fork without the extent being freed.
We do this for non-rt files, but we forgot to do this for realtime
files.  So far this isn't a big deal since nobody makes a bunmapi call
to a rt file with the REMAP flag set, but don't leave a logic bomb.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/libxfs/xfs_bmap.c