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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Sep 2017 06:19:58 +0000 (08:19 +0200)
commit621d0b75a3476bce5f1d4e13bb99deaf57b9289d
treeadf33d059798afb86950b3cecbd0bbd65d8060b3
parent8913492d12b1e71bd89bb234408483b7c56700e0
xfs: don't allow bmap on rt files

commit 61d819e7bcb7f33da710bf3f5dcb2bcf1e48203c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_aops.c