diff options
Diffstat (limited to 'fs/jbd')
-rw-r--r-- | fs/jbd/journal.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 737f7246a4b5..94a64a199a63 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -848,6 +848,12 @@ static int journal_reset(journal_t *journal) | |||
848 | 848 | ||
849 | first = be32_to_cpu(sb->s_first); | 849 | first = be32_to_cpu(sb->s_first); |
850 | last = be32_to_cpu(sb->s_maxlen); | 850 | last = be32_to_cpu(sb->s_maxlen); |
851 | if (first + JFS_MIN_JOURNAL_BLOCKS > last + 1) { | ||
852 | printk(KERN_ERR "JBD: Journal too short (blocks %lu-%lu).\n", | ||
853 | first, last); | ||
854 | journal_fail_superblock(journal); | ||
855 | return -EINVAL; | ||
856 | } | ||
851 | 857 | ||
852 | journal->j_first = first; | 858 | journal->j_first = first; |
853 | journal->j_last = last; | 859 | journal->j_last = last; |