aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2008-01-28 23:58:26 -0500
committerTheodore Ts'o <tytso@mit.edu>2008-01-28 23:58:26 -0500
commitbb4f397a1a7f2330cb173233599aa159f5780f58 (patch)
treeeaa1605d6ddc816479803e98b82e26b8f0afdfb0 /fs/ext4/super.c
parente7c95593001cb96ef5dd121a4523286c574c7133 (diff)
ext4: Change the default behaviour on error
ext4 file system was by default ignoring errors and continuing. This is not a good default as continuing on error could lead to file system corruption. Change the default to mark the file system readonly. Debian and ubuntu already does this as the default in their fstab. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Acked-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 32e3ecb35cd7..effd375ece80 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -688,16 +688,16 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
688 le16_to_cpu(es->s_def_resgid) != EXT4_DEF_RESGID) { 688 le16_to_cpu(es->s_def_resgid) != EXT4_DEF_RESGID) {
689 seq_printf(seq, ",resgid=%u", sbi->s_resgid); 689 seq_printf(seq, ",resgid=%u", sbi->s_resgid);
690 } 690 }
691 if (test_opt(sb, ERRORS_CONT)) { 691 if (test_opt(sb, ERRORS_RO)) {
692 int def_errors = le16_to_cpu(es->s_errors); 692 int def_errors = le16_to_cpu(es->s_errors);
693 693
694 if (def_errors == EXT4_ERRORS_PANIC || 694 if (def_errors == EXT4_ERRORS_PANIC ||
695 def_errors == EXT4_ERRORS_RO) { 695 def_errors == EXT4_ERRORS_CONTINUE) {
696 seq_puts(seq, ",errors=continue"); 696 seq_puts(seq, ",errors=remount-ro");
697 } 697 }
698 } 698 }
699 if (test_opt(sb, ERRORS_RO)) 699 if (test_opt(sb, ERRORS_CONT))
700 seq_puts(seq, ",errors=remount-ro"); 700 seq_puts(seq, ",errors=continue");
701 if (test_opt(sb, ERRORS_PANIC)) 701 if (test_opt(sb, ERRORS_PANIC))
702 seq_puts(seq, ",errors=panic"); 702 seq_puts(seq, ",errors=panic");
703 if (test_opt(sb, NO_UID32)) 703 if (test_opt(sb, NO_UID32))
@@ -1819,10 +1819,10 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
1819 1819
1820 if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC) 1820 if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC)
1821 set_opt(sbi->s_mount_opt, ERRORS_PANIC); 1821 set_opt(sbi->s_mount_opt, ERRORS_PANIC);
1822 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_RO) 1822 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_CONTINUE)
1823 set_opt(sbi->s_mount_opt, ERRORS_RO);
1824 else
1825 set_opt(sbi->s_mount_opt, ERRORS_CONT); 1823 set_opt(sbi->s_mount_opt, ERRORS_CONT);
1824 else
1825 set_opt(sbi->s_mount_opt, ERRORS_RO);
1826 1826
1827 sbi->s_resuid = le16_to_cpu(es->s_def_resuid); 1827 sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
1828 sbi->s_resgid = le16_to_cpu(es->s_def_resgid); 1828 sbi->s_resgid = le16_to_cpu(es->s_def_resgid);