ext4: explicit mount options parsing cleanup
authorDmitry Monakhov <dmonakhov@openvz.org>
Mon, 19 Oct 2015 03:35:32 +0000 (23:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 19 Oct 2015 03:35:32 +0000 (23:35 -0400)
Currently MOPT_EXPLICIT treated as EXPLICIT_DELALLOC which may be changed
in future. Let's fix it now.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/super.c

index 639613fe20aa9c5b39b4c981fd28a4958000f52c..db4be39a8db7b519287d19f2b592ab500e7ce849 100644 (file)
@@ -1516,8 +1516,12 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
                return -1;
        if (args->from && (m->flags & MOPT_GTE0) && (arg < 0))
                return -1;
-       if (m->flags & MOPT_EXPLICIT)
-               set_opt2(sb, EXPLICIT_DELALLOC);
+       if (m->flags & MOPT_EXPLICIT) {
+               if (m->mount_opt & EXT4_MOUNT_DELALLOC) {
+                       set_opt2(sb, EXPLICIT_DELALLOC);
+               } else
+                       return -1;
+       }
        if (m->flags & MOPT_CLEAR_ERR)
                clear_opt(sb, ERRORS_MASK);
        if (token == Opt_noquota && sb_any_quota_loaded(sb)) {