Skip to content

Commit 39ef17f

Browse files
committed
ext4: simplify handling of the errors=* mount options
Signed-off-by: "Theodore Ts'o" <[email protected]>
1 parent c64db50 commit 39ef17f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

fs/ext4/ext4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ struct ext4_inode_info {
924924
#define EXT4_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */
925925
#define EXT4_MOUNT_ERRORS_RO 0x00020 /* Remount fs ro on errors */
926926
#define EXT4_MOUNT_ERRORS_PANIC 0x00040 /* Panic on errors */
927+
#define EXT4_MOUNT_ERRORS_MASK 0x00070
927928
#define EXT4_MOUNT_MINIX_DF 0x00080 /* Mimics the Minix statfs */
928929
#define EXT4_MOUNT_NOLOAD 0x00100 /* Don't use existing journal*/
929930
#define EXT4_MOUNT_DATA_FLAGS 0x00C00 /* Mode for data writes: */

fs/ext4/super.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,18 +1565,15 @@ static int parse_options(char *options, struct super_block *sb,
15651565
/* *sb_block = match_int(&args[0]); */
15661566
break;
15671567
case Opt_err_panic:
1568-
clear_opt(sb, ERRORS_CONT);
1569-
clear_opt(sb, ERRORS_RO);
1568+
clear_opt(sb, ERRORS_MASK);
15701569
set_opt(sb, ERRORS_PANIC);
15711570
break;
15721571
case Opt_err_ro:
1573-
clear_opt(sb, ERRORS_CONT);
1574-
clear_opt(sb, ERRORS_PANIC);
1572+
clear_opt(sb, ERRORS_MASK);
15751573
set_opt(sb, ERRORS_RO);
15761574
break;
15771575
case Opt_err_cont:
1578-
clear_opt(sb, ERRORS_RO);
1579-
clear_opt(sb, ERRORS_PANIC);
1576+
clear_opt(sb, ERRORS_MASK);
15801577
set_opt(sb, ERRORS_CONT);
15811578
break;
15821579
case Opt_nouid32:

0 commit comments

Comments
 (0)