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

Message ID 1539027169-23332-4-git-send-email-sandeen@sandeen.net
State New
Headers show
Series
  • ext2, ext4, xfs: hard fail dax mount on unsupported devices
Related show

Commit Message

Eric Sandeen Oct. 8, 2018, 7:32 p.m.
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/ext2/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 73bd58f..b9471c0 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -967,8 +967,8 @@  static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 	if (sbi->s_mount_opt & EXT2_MOUNT_DAX) {
 		if (!bdev_dax_supported(sb->s_bdev, blocksize)) {
 			ext2_msg(sb, KERN_ERR,
-				"DAX unsupported by block device. Turning off DAX.");
-			sbi->s_mount_opt &= ~EXT2_MOUNT_DAX;
+				"DAX unsupported by block device.");
+			goto failed_mount;
 		}
 	}