[lkml]   [2008]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: lockdep splat from ioctl and mmap fops sharing lock
Johannes Weiner wrote:
> Johannes Weiner <> writes:
>> Hi,
>> fb_mmap() is called under mmap_sem and acquires fb_info->lock.
>> Since 3e680aae4e53ab "fb: convert lock/unlock_kernel() into local fb
>> mutex", fb_ioctl() takes fb_info->lock and does copy_to/from_user()
>> under it, which in turn might acquire mmap_sem.
> More affected drivers:
> agp_ioctl() doing usercopy under agp_fe.agp_mutex
> agp_mmap() taking agp_fe.agp_mutex under mmap_sem
> dv1394_write() doing usercopy under video->mtx
> dv1394_mmap() taking video->mtx under mmap_sem

OK, it doesn't surprise me that I didn't notice this one myself: The
video->mtx usage is old, but dv1394 is not frequently used anymore; I
for one don't test anything of it beyond loading and unloading.

> raw1394_ioctl() doing usercopy under fi->state_mutex
> raw1394_mmap() taking fi->state_mutex under mmap_sem

The state_mutex in raw1394 however was introduced by me in patches
written against 2.6.26 and 2.6.27-rcs. And I tested the ioctls and I'd
like to think that I also tested mmaps. But maybe I didn't. Of course
I ahve all sorts of lockdep options enabled.

So, was the usage of mmap_sem changed after 2.6.27 or were my tests
Stefan Richter
-=====-==--- =-=- =-===

 \ /
  Last update: 2008-10-23 17:13    [W:0.059 / U:97.052 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site