diff options
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 09d9359c8055..cb96f127c366 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -671,6 +671,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
671 | unsigned long def_mount_opts; | 671 | unsigned long def_mount_opts; |
672 | struct super_block *sb = vfs->mnt_sb; | 672 | struct super_block *sb = vfs->mnt_sb; |
673 | struct ext4_sb_info *sbi = EXT4_SB(sb); | 673 | struct ext4_sb_info *sbi = EXT4_SB(sb); |
674 | journal_t *journal = sbi->s_journal; | ||
674 | struct ext4_super_block *es = sbi->s_es; | 675 | struct ext4_super_block *es = sbi->s_es; |
675 | 676 | ||
676 | def_mount_opts = le32_to_cpu(es->s_default_mount_opts); | 677 | def_mount_opts = le32_to_cpu(es->s_default_mount_opts); |
@@ -729,8 +730,15 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
729 | seq_printf(seq, ",commit=%u", | 730 | seq_printf(seq, ",commit=%u", |
730 | (unsigned) (sbi->s_commit_interval / HZ)); | 731 | (unsigned) (sbi->s_commit_interval / HZ)); |
731 | } | 732 | } |
732 | if (test_opt(sb, BARRIER)) | 733 | /* |
733 | seq_puts(seq, ",barrier=1"); | 734 | * We're changing the default of barrier mount option, so |
735 | * let's always display its mount state so it's clear what its | ||
736 | * status is. | ||
737 | */ | ||
738 | seq_puts(seq, ",barrier="); | ||
739 | seq_puts(seq, test_opt(sb, BARRIER) ? "1" : "0"); | ||
740 | if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) | ||
741 | seq_puts(seq, ",journal_async_commit"); | ||
734 | if (test_opt(sb, NOBH)) | 742 | if (test_opt(sb, NOBH)) |
735 | seq_puts(seq, ",nobh"); | 743 | seq_puts(seq, ",nobh"); |
736 | if (!test_opt(sb, EXTENTS)) | 744 | if (!test_opt(sb, EXTENTS)) |
@@ -1907,6 +1915,7 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
1907 | sbi->s_resgid = le16_to_cpu(es->s_def_resgid); | 1915 | sbi->s_resgid = le16_to_cpu(es->s_def_resgid); |
1908 | 1916 | ||
1909 | set_opt(sbi->s_mount_opt, RESERVATION); | 1917 | set_opt(sbi->s_mount_opt, RESERVATION); |
1918 | set_opt(sbi->s_mount_opt, BARRIER); | ||
1910 | 1919 | ||
1911 | /* | 1920 | /* |
1912 | * turn on extents feature by default in ext4 filesystem | 1921 | * turn on extents feature by default in ext4 filesystem |
@@ -2189,6 +2198,29 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent) | |||
2189 | EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) { | 2198 | EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) { |
2190 | if (ext4_load_journal(sb, es, journal_devnum)) | 2199 | if (ext4_load_journal(sb, es, journal_devnum)) |
2191 | goto failed_mount3; | 2200 | goto failed_mount3; |
2201 | if (!(sb->s_flags & MS_RDONLY) && | ||
2202 | EXT4_SB(sb)->s_journal->j_failed_commit) { | ||
2203 | printk(KERN_CRIT "EXT4-fs error (device %s): " | ||
2204 | "ext4_fill_super: Journal transaction " | ||
2205 | "%u is corrupt\n", sb->s_id, | ||
2206 | EXT4_SB(sb)->s_journal->j_failed_commit); | ||
2207 | if (test_opt (sb, ERRORS_RO)) { | ||
2208 | printk (KERN_CRIT | ||
2209 | "Mounting filesystem read-only\n"); | ||
2210 | sb->s_flags |= MS_RDONLY; | ||
2211 | EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; | ||
2212 | es->s_state |= cpu_to_le16(EXT4_ERROR_FS); | ||
2213 | } | ||
2214 | if (test_opt(sb, ERRORS_PANIC)) { | ||
2215 | EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; | ||
2216 | es->s_state |= cpu_to_le16(EXT4_ERROR_FS); | ||
2217 | ext4_commit_super(sb, es, 1); | ||
2218 | printk(KERN_CRIT | ||
2219 | "EXT4-fs (device %s): mount failed\n", | ||
2220 | sb->s_id); | ||
2221 | goto failed_mount4; | ||
2222 | } | ||
2223 | } | ||
2192 | } else if (journal_inum) { | 2224 | } else if (journal_inum) { |
2193 | if (ext4_create_journal(sb, es, journal_inum)) | 2225 | if (ext4_create_journal(sb, es, journal_inum)) |
2194 | goto failed_mount3; | 2226 | goto failed_mount3; |