xfs: don't allow bmap on rt files
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 19 Jun 2017 20:19:08 +0000 (13:19 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 20 Jun 2017 17:45:22 +0000 (10:45 -0700)
commit61d819e7bcb7f33da710bf3f5dcb2bcf1e48203c
treef4ca9403fcfaadbf121670af744152e64ae06eb3
parent5da8f2f8908aabcfa4113d37d470039c79962ba9
xfs: don't allow bmap on rt files

bmap returns a dumb LBA address but not the block device that goes with
that LBA.  Swapfiles don't care about this and will blindly assume that
the data volume is the correct blockdev, which is totally bogus for
files on the rt subvolume.  This results in the swap code doing IOs to
arbitrary locations on the data device(!) if the passed in mapping is a
realtime file, so just turn off bmap for rt files.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_aops.c