Remove BKL removal patches, since they don't seem to be portable on
[ext4-patch-queue.git] / change-default-ext4-error.patch
blobed0f950d9dc5c20c75a4cad54ae854ed154f8c0e
1 ext4: Change the default behaviour on error
3 From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
5 ext4 file system was by default ignoring errors and continuing. This
6 is not a good default as continuing on error could lead to file system
7 corruption. Change the default to mark the file system
8 readonly. Debian and ubuntu already does this as the default in their
9 fstab.
11 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
12 Acked-by: Eric Sandeen <sandeen@redhat.com>
13 Signed-off-by: Mingming Cao <cmm@us.ibm.com>
14 ---
16 fs/ext4/super.c | 16 ++++++++--------
17 1 files changed, 8 insertions(+), 8 deletions(-)
20 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
21 index 32e3ecb..effd375 100644
22 --- a/fs/ext4/super.c
23 +++ b/fs/ext4/super.c
24 @@ -688,16 +688,16 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
25 le16_to_cpu(es->s_def_resgid) != EXT4_DEF_RESGID) {
26 seq_printf(seq, ",resgid=%u", sbi->s_resgid);
28 - if (test_opt(sb, ERRORS_CONT)) {
29 + if (test_opt(sb, ERRORS_RO)) {
30 int def_errors = le16_to_cpu(es->s_errors);
32 if (def_errors == EXT4_ERRORS_PANIC ||
33 - def_errors == EXT4_ERRORS_RO) {
34 - seq_puts(seq, ",errors=continue");
35 + def_errors == EXT4_ERRORS_CONTINUE) {
36 + seq_puts(seq, ",errors=remount-ro");
39 - if (test_opt(sb, ERRORS_RO))
40 - seq_puts(seq, ",errors=remount-ro");
41 + if (test_opt(sb, ERRORS_CONT))
42 + seq_puts(seq, ",errors=continue");
43 if (test_opt(sb, ERRORS_PANIC))
44 seq_puts(seq, ",errors=panic");
45 if (test_opt(sb, NO_UID32))
46 @@ -1819,10 +1819,10 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
48 if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC)
49 set_opt(sbi->s_mount_opt, ERRORS_PANIC);
50 - else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_RO)
51 - set_opt(sbi->s_mount_opt, ERRORS_RO);
52 - else
53 + else if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_CONTINUE)
54 set_opt(sbi->s_mount_opt, ERRORS_CONT);
55 + else
56 + set_opt(sbi->s_mount_opt, ERRORS_RO);
58 sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
59 sbi->s_resgid = le16_to_cpu(es->s_def_resgid);