Bug 480239

Summary: losetup: circular locking dependency
Product: [openSUSE] openSUSE 11.1 Reporter: Jiri Slaby <jslaby>
Component: KernelAssignee: Jiri Slaby <jslaby>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P3 - Medium CC: gp, xuantao
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: Other   
URL: http://bugzilla.kernel.org/show_bug.cgi?id=10504
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 370872    

Description Jiri Slaby 2009-02-27 07:18:46 UTC
usbhid: v2.6:USB HID core driver

=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.27.17-20090217_954248e4-default #1
-------------------------------------------------------
losetup/1734 is trying to acquire lock:
 (&bdev->bd_mutex){--..}, at: [<c01b901f>] __blkdev_put+0x1f/0x121

but task is already holding lock:
 (&lo->lo_ctl_mutex){--..}, at: [<f9260a9f>] lo_ioctl+0x39/0x12a [loop]

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&lo->lo_ctl_mutex){--..}:
       [<c0148788>] add_lock_to_list+0x71/0xa0
       [<c014abe8>] check_prev_add+0x30f/0x46f
       [<c014b12b>] validate_chain+0x3e3/0x50b
       [<c014b898>] __lock_acquire+0x645/0x6ac
       [<c014b970>] lock_acquire+0x71/0x93
       [<c034fe6f>] mutex_lock_nested+0xe4/0x28d
       [<f925f207>] lo_open+0x20/0x2f [loop]
       [<c01b9433>] do_open+0xc4/0x2bb
       [<c01b964f>] blkdev_open+0x25/0x4d
       [<c0194505>] __dentry_open+0x10e/0x1fd
       [<c019468c>] nameidata_to_filp+0x27/0x37
       [<c019fbae>] do_filp_open+0x377/0x703
       [<c01942fb>] do_sys_open+0x46/0xcc
       [<c01943cf>] sys_open+0x23/0x28
       [<c0104c4b>] sysenter_do_call+0x12/0x3f
       [<ffffe430>] 0xffffe430
       [<ffffffff>] 0xffffffff

-> #0 (&bdev->bd_mutex){--..}:
       [<c014a51a>] print_circular_bug_tail+0x6d/0xa6
       [<c014b12b>] validate_chain+0x3e3/0x50b
       [<c014b898>] __lock_acquire+0x645/0x6ac
       [<c014b970>] lock_acquire+0x71/0x93
       [<c034fe6f>] mutex_lock_nested+0xe4/0x28d
       [<c01b901f>] __blkdev_put+0x1f/0x121
       [<c0196bbe>] __fput+0x99/0x14a
       [<f9260390>] loop_clr_fd+0x150/0x17d [loop]
       [<f9260af4>] lo_ioctl+0x8e/0x12a [loop]
       [<c0213cda>] blkdev_driver_ioctl+0x4e/0x5e
       [<c02145d2>] blkdev_ioctl+0x206/0x220
       [<c01b8b65>] block_ioctl+0x18/0x1b
       [<c01a0a0b>] vfs_ioctl+0x1f/0x62
       [<c01a0c9f>] do_vfs_ioctl+0x167/0x172
       [<c01a0cef>] sys_ioctl+0x45/0x5e
       [<c0104c4b>] sysenter_do_call+0x12/0x3f
       [<ffffe430>] 0xffffe430
       [<ffffffff>] 0xffffffff

other info that might help us debug this:

1 lock held by losetup/1734:
 #0:  (&lo->lo_ctl_mutex){--..}, at: [<f9260a9f>] lo_ioctl+0x39/0x12a [loop]

stack backtrace:
Pid: 1734, comm: losetup Tainted: G          2.6.27.17-20090217_954248e4-default #1
 [<c010661a>] dump_trace+0x6b/0x249
 [<c01071a9>] show_trace+0x20/0x39
 [<c034ed6d>] dump_stack+0x71/0x76
 [<c014a54b>] print_circular_bug_tail+0x9e/0xa6
 [<c014b12b>] validate_chain+0x3e3/0x50b
 [<c014b898>] __lock_acquire+0x645/0x6ac
 [<c014b970>] lock_acquire+0x71/0x93
 [<c034fe6f>] mutex_lock_nested+0xe4/0x28d
 [<c01b901f>] __blkdev_put+0x1f/0x121
 [<c0196bbe>] __fput+0x99/0x14a
 [<f9260390>] loop_clr_fd+0x150/0x17d [loop]
 [<f9260af4>] lo_ioctl+0x8e/0x12a [loop]
 [<c0213cda>] blkdev_driver_ioctl+0x4e/0x5e
 [<c02145d2>] blkdev_ioctl+0x206/0x220
 [<c01b8b65>] block_ioctl+0x18/0x1b
 [<c01a0a0b>] vfs_ioctl+0x1f/0x62
 [<c01a0c9f>] do_vfs_ioctl+0x167/0x172
 [<c01a0cef>] sys_ioctl+0x45/0x5e
 [<c0104c4b>] sysenter_do_call+0x12/0x3f
 [<ffffe430>] 0xffffe430
 =======================
bootsplash: status on console 0 changed to on
Comment 3 Nikanth Karthikesan 2009-03-24 14:53:16 UTC
This is fixed in mainline, http://git.kernel.org/?p=linux/kernel/git/axboe/linux-2.6-block.git;a=commit;h=7345a058962e92a284eeb27e73cae29686766421
But SL11 does not require them as this is just a false positive and the warning wont show up as CONFIG_PROVE_LOCKING is not set.