From: Greg KH on
2.6.33-stable review patch. If anyone has any objections, please let us know.


From: Jeff Mahoney <jeffm(a)>

commit b7b7fa43103a9fb30dbcc60cbd5161fdfc25f904 upstream.

Commit 8ebc423238341b52912c7295b045a32477b33f09 (reiserfs: kill-the-BKL)
introduced a bug in the mount failure case.

The error label releases the lock before calling journal_release_error,
but it requires that the lock be held. do_journal_release unlocks and
retakes it. When it releases it without it held, we trigger a BUG().

The error_alloc label skips the unlock since the lock isn't held yet
but none of the other conditions that are clean up exist yet either.

This patch returns immediately after the kzalloc failure and moves
the reiserfs_write_unlock after the journal_release_error call.

This was reported in

Reported-by: Thomas Siedentopf <thomas.siedentopf(a)>
Signed-off-by: Jeff Mahoney <jeffm(a)>
Cc: Thomas Siedentopf <thomas.siedentopf(a)>
Cc: Andrew Morton <akpm(a)>
Signed-off-by: Frederic Weisbecker <fweisbec(a)>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)>

fs/reiserfs/super.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1619,10 +1619,8 @@ static int reiserfs_fill_super(struct su
save_mount_options(s, data);

sbi = kzalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL);
- if (!sbi) {
- errval = -ENOMEM;
- goto error_alloc;
- }
+ if (!sbi)
+ return -ENOMEM;
s->s_fs_info = sbi;
/* Set default values for options: non-aggressive tails, RO on errors */
REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_SMALLTAIL);
@@ -1879,12 +1877,12 @@ static int reiserfs_fill_super(struct su
return (0);

- reiserfs_write_unlock(s);
if (jinit_done) { /* kill the commit thread, free journal ram */
journal_release_error(NULL, s);

+ reiserfs_write_unlock(s);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at