summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-08-30 08:56:55 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-08-30 22:43:58 -0700
commitadcb0ca2330b1d88533e70026ce3f9cc5e2253b6 (patch)
tree626e50ab22c8325f3709e7dd87344ff70f625de6 /fs/xfs
parent40144e49ff84c3bd6bd091b58115257670be8803 (diff)
downloadlinux-adcb0ca2330b1d88533e70026ce3f9cc5e2253b6.tar.bz2
xfs: fix the dax supported check in xfs_ioctl_setattr_dax_invalidate
Setting the DAX flag on the directory of a file system that is not on a DAX capable device makes as little sense as setting it on a regular file on the same file system. Signed-off-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>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_ioctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 495565feae4f..9a6823e29661 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1309,8 +1309,7 @@ xfs_ioctl_setattr_dax_invalidate(
if (fa->fsx_xflags & FS_XFLAG_DAX) {
if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)))
return -EINVAL;
- if (S_ISREG(inode->i_mode) &&
- !bdev_dax_supported(xfs_find_bdev_for_inode(VFS_I(ip)),
+ if (!bdev_dax_supported(xfs_find_bdev_for_inode(VFS_I(ip)),
sb->s_blocksize))
return -EINVAL;
}