From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederic Weisbecker Subject: [PATCH 4/4] kill-the-bkl/reiserfs: panic in case of lock imbalance Date: Tue, 25 Aug 2009 04:32:50 +0200 Message-ID: <1251167570-5233-5-git-send-email-fweisbec@gmail.com> References: <1251167570-5233-1-git-send-email-fweisbec@gmail.com> Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:to; bh=KQcS4Lkj6OpdmtKTtVn33xExwBw2v4GWUx3XH55hDlA=; b=qzr9EfVqkswliAyq3dZDvAe3alG5J/LatbI/P24qn4XyOg1XXSUO8r1+ip/LxiJQrk rF+Tpd6Q8QTDtc8uy7sWOHJlyDKLwW7YNahE2wjuKYM4HEAeWdBtQWHDQV2CLYmnDA+e bVwhZABRguN+9x7loBE3Ui0hNBV39uQxzqFO8= In-Reply-To: <1251167570-5233-1-git-send-email-fweisbec@gmail.com> Sender: reiserfs-devel-owner@vger.kernel.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: LKML Cc: LKML , Frederic Weisbecker , Chris Mason , Roland Dreier , Ingo Molnar , Andi Kleen , Jeff Mahoney , Alexander Beregalov , Bron Gondwana , Reiserfs , Al Viro , Andrea Gelmini , "Trenton D. Adams" , Thomas Meyer , Alessio Igor Bogani , Marcel Hilzinger , Edward Shishkin , Laurent Riffard 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 Cc: Jeff Mahoney Cc: Chris Mason Cc: Ingo Molnar Cc: Alexander Beregalov Cc: Laurent Riffard --- 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