Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97854
b: refs/heads/master
c: 624080e
h: refs/heads/master
v: v3
  • Loading branch information
Theodore Ts'o committed Jun 6, 2008
1 parent 0888c31 commit f5fee50
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ea76900be3b4522396e2021260d2818a27b3a5b
refs/heads/master: 624080eded68738daee041ad64672a9d2614754f
23 changes: 23 additions & 0 deletions trunk/fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,29 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
if (ext4_load_journal(sb, es, journal_devnum))
goto failed_mount3;
if (!(sb->s_flags & MS_RDONLY) &&
EXT4_SB(sb)->s_journal->j_failed_commit) {
printk(KERN_CRIT "EXT4-fs error (device %s): "
"ext4_fill_super: Journal transaction "
"%u is corrupt\n", sb->s_id,
EXT4_SB(sb)->s_journal->j_failed_commit);
if (test_opt (sb, ERRORS_RO)) {
printk (KERN_CRIT
"Mounting filesystem read-only\n");
sb->s_flags |= MS_RDONLY;
EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
}
if (test_opt(sb, ERRORS_PANIC)) {
EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
ext4_commit_super(sb, es, 1);
printk(KERN_CRIT
"EXT4-fs (device %s): mount failed\n",
sb->s_id);
goto failed_mount4;
}
}
} else if (journal_inum) {
if (ext4_create_journal(sb, es, journal_inum))
goto failed_mount3;
Expand Down
11 changes: 4 additions & 7 deletions trunk/fs/jbd2/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,8 @@ static int do_one_pass(journal_t *journal,
chksum_err = chksum_seen = 0;

if (info->end_transaction) {
printk(KERN_ERR "JBD: Transaction %u "
"found to be corrupt.\n",
next_commit_ID - 1);
journal->j_failed_commit =
info->end_transaction;
brelse(bh);
break;
}
Expand Down Expand Up @@ -644,10 +643,8 @@ static int do_one_pass(journal_t *journal,

if (!JBD2_HAS_INCOMPAT_FEATURE(journal,
JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)){
printk(KERN_ERR
"JBD: Transaction %u "
"found to be corrupt.\n",
next_commit_ID);
journal->j_failed_commit =
next_commit_ID;
brelse(bh);
break;
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/jbd2.h
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,9 @@ struct journal_s
struct proc_dir_entry *j_proc_entry;
struct transaction_stats_s j_stats;

/* Failed journal commit ID */
unsigned int j_failed_commit;

/*
* An opaque pointer to fs-private information. ext3 puts its
* superblock pointer here
Expand Down

0 comments on commit f5fee50

Please sign in to comment.