mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
jbd: Fail to load a journal if it is too short
Due to on disk corruption, it can happen that journal is too short. Fail to load it in such case so that we don't oops somewhere later. Reported-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
e9e961c9a8
commit
7447a668a3
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue