diff mbox series

xfs: fix the dax supported check in xfs_ioctl_setattr_dax_invalidate

Message ID 20190830102315.27325-1-hch@lst.de (mailing list archive)
State Accepted
Headers show
Series xfs: fix the dax supported check in xfs_ioctl_setattr_dax_invalidate | expand

Commit Message

Christoph Hellwig Aug. 30, 2019, 10:23 a.m. UTC
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>
---
 fs/xfs/xfs_ioctl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Darrick J. Wong Sept. 6, 2019, 1:03 a.m. UTC | #1
On Fri, Aug 30, 2019 at 12:23:15PM +0200, Christoph Hellwig wrote:
> 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>

Weirdly, I never explicitly acknoweledged this...

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_ioctl.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 9ea51664932e..d1d0929aa462 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;
>  	}
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 9ea51664932e..d1d0929aa462 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;
 	}