[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <47D7FAA0.1090802@linux.vnet.ibm.com>
Date: Wed, 12 Mar 2008 16:45:36 +0100
From: Frank Munzert <frankm@...ux.vnet.ibm.com>
To: mingo@...e.hu
CC: linux-kernel@...r.kernel.org
Subject: BUG: lock held when returning to user space
Hi Ingo,
we provided a device driver vmur dealing with z/VM virtual unit record
devices (reader, punch, printer). A corresponding user space tool
provides functions similar to the CMS commands RECEIVE, PUNCH, PRINT.
Unit record devices are not meant for concurrent read or write by
multiple users, that's why we need to serialize access. The driver's
open method uses mutex_trylock or mutex_lock_interruptible to ensure
exclusive access to the device, while its release method uses
mutex_unlock.
As a consequence, lockdep complains about locks being held when
returning to user space. We used a very simple char device driver
(appended below) to produce this message:
================================================
[ BUG: lock held when returning to user space! ]
------------------------------------------------
testapp/2683 is leaving the kernel with locks still held!
1 lock held by testapp/2683:
#0: (&test_mutex){--..}, at: [<000003e00003316c>] test_open+0x30/0x64
[test]
For the vmur device driver it is crucial to have only one process access
a given unit record device node at a given time. So having open hold the
mutex and return to user space is exactly what we want. Is there any
annotation to tell lockdep to suppress or bypass this kind of warning?
Thanks in advance,
Frank
View attachment "test.c" of type "text/plain" (1931 bytes)
Powered by blists - more mailing lists