add patch explicit-mount-options-parsing-cleanup
[ext4-patch-queue.git] / explicit-mount-options-parsing-cleanup
blob75aa22aef2ab4b341d8e529cb28827e54a0f843e
1 ext4: explicit mount options parsing cleanup
3 From: Dmitry Monakhov <dmonakhov@openvz.org>
5 Currently MOPT_EXPLICIT treated as EXPLICIT_DELALLOC which may be changed
6 in future. Let's fix it now.
8 Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 ---
11  fs/ext4/super.c |    8 ++++++--
12  1 files changed, 6 insertions(+), 2 deletions(-)
14 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
15 index 7ef3fa5..e91f6d4 100644
16 --- a/fs/ext4/super.c
17 +++ b/fs/ext4/super.c
18 @@ -1503,8 +1503,12 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
19                 return -1;
20         if (args->from && (m->flags & MOPT_GTE0) && (arg < 0))
21                 return -1;
22 -       if (m->flags & MOPT_EXPLICIT)
23 -               set_opt2(sb, EXPLICIT_DELALLOC);
24 +       if (m->flags & MOPT_EXPLICIT) {
25 +               if (m->mount_opt & EXT4_MOUNT_DELALLOC) {
26 +                       set_opt2(sb, EXPLICIT_DELALLOC);
27 +               } else
28 +                       return -1;
29 +       }
30         if (m->flags & MOPT_CLEAR_ERR)
31                 clear_opt(sb, ERRORS_MASK);
32         if (token == Opt_noquota && sb_any_quota_loaded(sb)) {
33 -- 
34 1.7.1