mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
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>
This commit is contained in:
parent
7e94277050
commit
8050318598
1 changed files with 3 additions and 4 deletions
|
@ -37,11 +37,10 @@ void reiserfs_write_unlock(struct super_block *s)
|
|||
|
||||
/*
|
||||
* Are we unlocking without even holding the lock?
|
||||
* Such a situation could even raise a BUG() if we don't
|
||||
* want the data become corrupted
|
||||
* Such a situation must raise a BUG() if we don't want
|
||||
* to corrupt the data.
|
||||
*/
|
||||
WARN_ONCE(sb_i->lock_owner != current,
|
||||
"Superblock write lock imbalance");
|
||||
BUG_ON(sb_i->lock_owner != current);
|
||||
|
||||
if (--sb_i->lock_depth == -1) {
|
||||
sb_i->lock_owner = NULL;
|
||||
|
|
Loading…
Reference in a new issue