xfs: validate bdev support for DAX inode flag
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Mon, 18 Sep 2017 21:46:03 +0000 (14:46 -0700)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 8 Oct 2017 01:09:38 +0000 (01:09 +0000)
commitf29f92257312c9c6c5d8872c3ab34856a8cbf4cf
treeb4c1fee5cebb10bef62da3d10ccac077ef6dd3ba
parent71c0d81c2630001ef5a96ddab2f87bec23f62505
xfs: validate bdev support for DAX inode flag

commit 6851a3db7e224bbb85e23b3c64a506c9e0904382 upstream.

Currently only the blocksize is checked, but we should really be calling
bdev_dax_supported() which also tests to make sure we can get a
struct dax_device and that the dax_direct_access() path is working.

This is the same check that we do for the "-o dax" mount option in
xfs_fs_fill_super().

This does not fix the race issues that caused the XFS DAX inode option to
be disabled, so that option will still be disabled.  If/when we re-enable
it, though, I think we will want this issue to have been fixed.  I also do
think that we want to fix this in stable kernels.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_ioctl.c