diff mbox series

[1/3] xfs: hard fail dax mount on unsupported devices

Message ID 1539027169-23332-2-git-send-email-sandeen@sandeen.net
State Not Applicable
Headers show
Series ext2, ext4, xfs: hard fail dax mount on unsupported devices | expand

Commit Message

Eric Sandeen Oct. 8, 2018, 7:32 p.m. UTC
As dax inches closer to production use, an administrator should not
be surprised by silently disabling the feature they asked for.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
 fs/xfs/xfs_super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Dave Chinner Oct. 8, 2018, 10:10 p.m. UTC | #1
On Mon, Oct 08, 2018 at 02:32:47PM -0500, Eric Sandeen wrote:
> As dax inches closer to production use, an administrator should not
> be surprised by silently disabling the feature they asked for.
> 
> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
> ---
>  fs/xfs/xfs_super.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 207ee30..a0a32cd 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1674,9 +1674,9 @@ struct proc_xfs_info {
>  			rtdev_is_dax = bdev_dax_supported(
>  				mp->m_rtdev_targp->bt_bdev, sb->s_blocksize);
>  		if (!rtdev_is_dax && !datadev_is_dax) {
> -			xfs_alert(mp,
> -			"DAX unsupported by block device. Turning off DAX.");
> -			mp->m_flags &= ~XFS_MOUNT_DAX;
> +			xfs_alert(mp, "DAX unsupported by block device.");
> +			error = -EINVAL;
> +			goto out_filestream_unmount;
>  		}
>  		if (xfs_sb_version_hasreflink(&mp->m_sb)) {
>  			xfs_alert(mp,

Looks good, I'll throw it in the stack for 4.20.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 207ee30..a0a32cd 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1674,9 +1674,9 @@  struct proc_xfs_info {
 			rtdev_is_dax = bdev_dax_supported(
 				mp->m_rtdev_targp->bt_bdev, sb->s_blocksize);
 		if (!rtdev_is_dax && !datadev_is_dax) {
-			xfs_alert(mp,
-			"DAX unsupported by block device. Turning off DAX.");
-			mp->m_flags &= ~XFS_MOUNT_DAX;
+			xfs_alert(mp, "DAX unsupported by block device.");
+			error = -EINVAL;
+			goto out_filestream_unmount;
 		}
 		if (xfs_sb_version_hasreflink(&mp->m_sb)) {
 			xfs_alert(mp,