Commit 24f3478d authored by Dan Williams's avatar Dan Williams

ext4: auto disable dax instead of failing mount

Bring the ext4 filesystem in line with xfs that only warns and continues
when the "-o dax" option is specified to mount and the backing device
does not support dax. This is in preparation for removing dax support
from devices that do not enable get_user_pages() operations on dax
mappings. In other words 'gup' support is required and configurations
that were using so called 'page-less' dax will be converted back to
using the page cache.

Removing the broken 'page-less' dax support is a pre-requisite for
removing the "EXPERIMENTAL" warning when mounting a filesystem in dax
mode.
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 785a3fab
...@@ -3710,11 +3710,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) ...@@ -3710,11 +3710,14 @@ 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");
goto failed_mount; sbi->s_mount_opt &= ~EXT4_MOUNT_DAX;
} }
err = bdev_dax_supported(sb, blocksize); err = bdev_dax_supported(sb, blocksize);
if (err) if (err) {
goto failed_mount; ext4_msg(sb, KERN_ERR,
"DAX unsupported by block device. Turning off DAX.");
sbi->s_mount_opt &= ~EXT4_MOUNT_DAX;
}
} }
if (ext4_has_feature_encrypt(sb) && es->s_encryption_level) { if (ext4_has_feature_encrypt(sb) && es->s_encryption_level) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment