Skip to content

Commit 8050318

Browse files
committed
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: Frederic 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>
1 parent 7e94277 commit 8050318

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎fs/reiserfs/lock.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ void reiserfs_write_unlock(struct super_block *s)
3737

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

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

0 commit comments

Comments
 (0)