add patch hard-fail-dax-mount-on-unsupported-devices
[ext4-patch-queue.git] / hard-fail-dax-mount-on-unsupported-devices
blob5e76cb6e1d96f24ad4f20269eb3f2b97f08d6df4
1 ext4: hard fail dax mount on unsupported devices
3 From: Eric Sandeen <sandeen@sandeen.net>
5 As dax inches closer to production use, an administrator should not
6 be surprised by silently disabling the feature they asked for.
8 Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 ---
11  fs/ext4/super.c | 6 +++---
12  1 file changed, 3 insertions(+), 3 deletions(-)
14 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
15 index 5863fd2..bf0bea5 100644
16 --- a/fs/ext4/super.c
17 +++ b/fs/ext4/super.c
18 @@ -3821,12 +3821,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
19                 if (ext4_has_feature_inline_data(sb)) {
20                         ext4_msg(sb, KERN_ERR, "Cannot use DAX on a filesystem"
21                                         " that may contain inline data");
22 -                       sbi->s_mount_opt &= ~EXT4_MOUNT_DAX;
23 +                       goto failed_mount;
24                 }
25                 if (!bdev_dax_supported(sb->s_bdev, blocksize)) {
26                         ext4_msg(sb, KERN_ERR,
27 -                               "DAX unsupported by block device. Turning off DAX.");
28 -                       sbi->s_mount_opt &= ~EXT4_MOUNT_DAX;
29 +                               "DAX unsupported by block device.");
30 +                       goto failed_mount;
31                 }
32         }
34 -- 
35 1.8.3.1