summaryrefslogtreecommitdiff
path: root/fs/reiserfs/journal.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2005-12-06 19:14:09 -0800
committerDave Jones <davej@redhat.com>2005-12-06 19:14:09 -0800
commitfc457fa7c0cdbfe96812ba377e508880d600298f (patch)
tree514049d61cf8b1587141a375ba3ec4f71e09a9db /fs/reiserfs/journal.c
parentcc6e8de8f0fab61760bb7091fb19eef1406e17be (diff)
parente4f5c82a92c2a546a16af1614114eec19120e40a (diff)
Merge ../linus/
Diffstat (limited to 'fs/reiserfs/journal.c')
-rw-r--r--fs/reiserfs/journal.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 4b15761434bc..68b7b78638ff 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -2757,6 +2757,15 @@ int journal_init(struct super_block *p_s_sb, const char *j_dev_name,
journal->j_cnode_used = 0;
journal->j_must_wait = 0;
+ if (journal->j_cnode_free == 0) {
+ reiserfs_warning(p_s_sb, "journal-2004: Journal cnode memory "
+ "allocation failed (%ld bytes). Journal is "
+ "too large for available memory. Usually "
+ "this is due to a journal that is too large.",
+ sizeof (struct reiserfs_journal_cnode) * num_cnodes);
+ goto free_and_return;
+ }
+
init_journal_hash(p_s_sb);
jl = journal->j_current_jl;
jl->j_list_bitmap = get_list_bitmap(p_s_sb, jl);