diff options
-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) first = be32_to_cpu(sb->s_first); last = be32_to_cpu(sb->s_maxlen); + if (first + JFS_MIN_JOURNAL_BLOCKS > last + 1) { + printk(KERN_ERR "JBD: Journal too short (blocks %lu-%lu).\n", + first, last); + journal_fail_superblock(journal); + return -EINVAL; + } journal->j_first = first; journal->j_last = last; |