ext4: hard fail dax mount on unsupported devices

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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Eric Sandeen 2018-12-04 00:46:39 -05:00 committed by Theodore Ts'o
parent 32ea275008
commit 361d24d406
1 changed files with 3 additions and 3 deletions

View File

@ -3864,12 +3864,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
if (ext4_has_feature_inline_data(sb)) { if (ext4_has_feature_inline_data(sb)) {
ext4_msg(sb, KERN_ERR, "Cannot use DAX on a filesystem" ext4_msg(sb, KERN_ERR, "Cannot use DAX on a filesystem"
" that may contain inline data"); " that may contain inline data");
sbi->s_mount_opt &= ~EXT4_MOUNT_DAX; goto failed_mount;
} }
if (!bdev_dax_supported(sb->s_bdev, blocksize)) { if (!bdev_dax_supported(sb->s_bdev, blocksize)) {
ext4_msg(sb, KERN_ERR, ext4_msg(sb, KERN_ERR,
"DAX unsupported by block device. Turning off DAX."); "DAX unsupported by block device.");
sbi->s_mount_opt &= ~EXT4_MOUNT_DAX; goto failed_mount;
} }
} }