Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80503185 authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

kill-the-bkl/reiserfs: panic in case of lock imbalance



Until now, trying to unlock the reiserfs write lock whereas the current
task doesn't hold it lead to a simple warning.
We should actually warn and panic in this case to avoid the user datas
to reach an unstable state.

Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Alexander Beregalov <a.beregalov@gmail.com>
Cc: Laurent Riffard <laurent.riffard@free.fr>
parent 7e942770
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -37,11 +37,10 @@ void reiserfs_write_unlock(struct super_block *s)


	/*
	/*
	 * Are we unlocking without even holding the lock?
	 * Are we unlocking without even holding the lock?
	 * Such a situation could even raise a BUG() if we don't
	 * Such a situation must raise a BUG() if we don't want
	 * want the data become corrupted
	 * to corrupt the data.
	 */
	 */
	WARN_ONCE(sb_i->lock_owner != current,
	BUG_ON(sb_i->lock_owner != current);
		  "Superblock write lock imbalance");


	if (--sb_i->lock_depth == -1) {
	if (--sb_i->lock_depth == -1) {
		sb_i->lock_owner = NULL;
		sb_i->lock_owner = NULL;