From e9ce622422fca4faac16fc4892c3de62587203ea Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 12 Dec 2012 00:09:11 +0000 Subject: [PATCH] scst, persistent reservations: Fix a locking error Avoid that a command like sg_raw -r256 /dev/sda 5e 04 00 00 00 00 00 20 00 00 triggers the following error messages on a kernel with PROVE_LOCKING enabled: ===================================== [ BUG: bad unlock balance detected! ] 3.7.0-rc5-debug+ #1 Tainted: G O ------------------------------------- disk010_1/9985 is trying to release lock (&dev->dev_pr_mutex) at: [] mutex_unlock+0xe/0x10 but there are no more locks to release! other info that might help us debug this: no locks held by disk010_1/9985. stack backtrace: Pid: 9985, comm: disk010_1 Tainted: G O 3.7.0-rc5-debug+ #1 Call Trace: [] print_unlock_inbalance_bug+0xfe/0x110 [] lock_release+0x1f6/0x260 [] __mutex_unlock_slowpath+0x9a/0x170 [] mutex_unlock+0xe/0x10 [] scst_pr_write_unlock+0x4f/0xd0 [scst] [] scst_persistent_reserve_in_local+0x2cc/0x470 [scst] [] scst_do_local_exec+0x15f/0x1c0 [scst] [] scst_exec_check_blocking+0xd0/0x2c0 [scst] [] scst_exec_check_sn+0x195/0x2f0 [scst] [] scst_process_active_cmd+0x549/0x780 [scst] [] scst_do_job_active+0x89/0x1a0 [scst] [] scst_cmd_thread+0x183/0x310 [scst] [] kthread+0xed/0x100 [] ret_from_fork+0x7c/0xb0 Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4641 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 1 - 1 file changed, 1 deletion(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index e64ab1de3..6ba53943f 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -2190,7 +2190,6 @@ static int scst_persistent_reserve_in_local(struct scst_cmd *cmd) break; default: PRINT_ERROR("Unsupported action %x", action); - scst_pr_write_unlock(dev); goto out_unsup_act; }