Skip to content

Commit c93cf2d

Browse files
Dmitry Monakhovtytso
authored andcommitted
ext4: explicit mount options parsing cleanup
Currently MOPT_EXPLICIT treated as EXPLICIT_DELALLOC which may be changed in future. Let's fix it now. Signed-off-by: Dmitry Monakhov <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 4327ba5 commit c93cf2d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fs/ext4/super.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,8 +1516,12 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
15161516
return -1;
15171517
if (args->from && (m->flags & MOPT_GTE0) && (arg < 0))
15181518
return -1;
1519-
if (m->flags & MOPT_EXPLICIT)
1520-
set_opt2(sb, EXPLICIT_DELALLOC);
1519+
if (m->flags & MOPT_EXPLICIT) {
1520+
if (m->mount_opt & EXT4_MOUNT_DELALLOC) {
1521+
set_opt2(sb, EXPLICIT_DELALLOC);
1522+
} else
1523+
return -1;
1524+
}
15211525
if (m->flags & MOPT_CLEAR_ERR)
15221526
clear_opt(sb, ERRORS_MASK);
15231527
if (token == Opt_noquota && sb_any_quota_loaded(sb)) {

0 commit comments

Comments
 (0)