]> git.karo-electronics.de Git - karo-tx-linux.git/commit
reiserfs: Fix locking BUG during mount failure
authorJeff Mahoney <jeffm@jeffreymahoney.com>
Mon, 29 Mar 2010 19:12:39 +0000 (15:12 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:47:47 +0000 (07:47 -0700)
commit14d209ccb3a6eb7916f1d282e586afe8fd01b1dd
tree686d991ea8933b2b9ea3255cba43abfb6752fe82
parent59849d29a6d4dca434d2589e72e28d0c0ac99fcc
reiserfs: Fix locking BUG during mount failure

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 https://bugzilla.novell.com/show_bug.cgi?id=591807

Reported-by: Thomas Siedentopf <thomas.siedentopf@novell.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Cc: Thomas Siedentopf <thomas.siedentopf@novell.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/reiserfs/super.c