From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Chris Mason <chris.mason@oracle.com>,
Roland Dreier <rdreier@cisco.com>, Ingo Molnar <mingo@elte.hu>,
Andi Kleen <andi@firstfloor.org>, Jeff Mahoney <jeffm@suse.com>,
Alexander Beregalov <a.beregalov@gmail.com>,
Bron Gondwana <brong@fastmail.fm>,
Reiserfs <reiserfs-devel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Andrea Gelmini <andrea.gelmini@gmail.com>,
"Trenton D. Adams" <trenton.d.adams@gmail.com>,
Thomas Meyer <thomas@m3y3r.de>,
Alessio Igor Bogani <abogani@texware.it>,
Marcel Hilzinger <mhilzinger@linuxnewmedia.de>,
Edward Shishkin <edward.shishkin@gmail.com>,
Laurent Riffard <laurent.riffard@free.fr>
Subject: [PATCH 4/4] kill-the-bkl/reiserfs: panic in case of lock imbalance
Date: Tue, 25 Aug 2009 04:32:50 +0200 [thread overview]
Message-ID: <1251167570-5233-5-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1251167570-5233-1-git-send-email-fweisbec@gmail.com>
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>
---
fs/reiserfs/lock.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/reiserfs/lock.c b/fs/reiserfs/lock.c
index cb1bba3..ee2cfc0 100644
--- a/fs/reiserfs/lock.c
+++ b/fs/reiserfs/lock.c
@@ -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;
--
1.6.2.3
next prev parent reply other threads:[~2009-08-25 2:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-25 2:32 [PATCH 0/4] kill-the-bkl/reiserfs: fix some lock dependency inversions Frederic Weisbecker
2009-08-25 2:32 ` [PATCH 1/4] kill-the-bkl/reiserfs: fix "reiserfs lock" / "inode mutex" lock inversion dependency Frederic Weisbecker
2009-08-25 2:32 ` [PATCH 2/4] kill-the-bkl/reiserfs: fix recursive reiserfs lock in reiserfs_mkdir() Frederic Weisbecker
2009-08-25 2:32 ` [PATCH 3/4] kill-the-bkl/reiserfs: fix recursive reiserfs write lock in reiserfs_commit_write() Frederic Weisbecker
2009-08-25 2:32 ` Frederic Weisbecker [this message]
2009-08-26 20:13 ` [PATCH 0/4] kill-the-bkl/reiserfs: fix some lock dependency inversions Alexander Beregalov
2009-09-01 22:16 ` Frederic Weisbecker
2009-09-14 20:37 ` Frederic Weisbecker
2009-09-14 21:33 ` Alexander Beregalov
2009-09-14 21:50 ` Frederic Weisbecker
2009-09-16 20:37 ` Frederic Weisbecker
2009-09-16 23:37 ` Alexander Beregalov
2009-09-17 5:06 ` [PATCH] kill-the-bkl/reiserfs: Fix induced mm->mmap_sem to sysfs_mutex dependency Frederic Weisbecker
2009-09-22 13:55 ` Alexander Beregalov
2009-09-29 7:46 ` Frederic Weisbecker
2009-09-29 10:22 ` Alexander Beregalov
2009-10-05 18:12 ` [PATCH] kill-the-bkl/reiserfs: fix reiserfs lock to cpu_add_remove_lock dependency Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1251167570-5233-5-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=a.beregalov@gmail.com \
--cc=abogani@texware.it \
--cc=andi@firstfloor.org \
--cc=andrea.gelmini@gmail.com \
--cc=brong@fastmail.fm \
--cc=chris.mason@oracle.com \
--cc=edward.shishkin@gmail.com \
--cc=jeffm@suse.com \
--cc=laurent.riffard@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mhilzinger@linuxnewmedia.de \
--cc=mingo@elte.hu \
--cc=rdreier@cisco.com \
--cc=reiserfs-devel@vger.kernel.org \
--cc=thomas@m3y3r.de \
--cc=trenton.d.adams@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).