diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-02-20 16:58:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-20 20:10:16 -0500 |
commit | 6d740cd5b18bc8128e70f98cfde8c74ebd21cea1 (patch) | |
tree | c3283d3e98b04b66f1d8b15ff76dc7362ea12d2d | |
parent | d5c1682f9f8f4aa064f81fda67ea7b91fd829512 (diff) |
[PATCH] lockdep: annotate BLKPG_DEL_PARTITION
>=============================================
>[ INFO: possible recursive locking detected ]
>2.6.19-1.2909.fc7 #1
>---------------------------------------------
>anaconda/587 is trying to acquire lock:
> (&bdev->bd_mutex){--..}, at: [<c05fb380>] mutex_lock+0x21/0x24
>
>but task is already holding lock:
> (&bdev->bd_mutex){--..}, at: [<c05fb380>] mutex_lock+0x21/0x24
>
>other info that might help us debug this:
>1 lock held by anaconda/587:
> #0: (&bdev->bd_mutex){--..}, at: [<c05fb380>] mutex_lock+0x21/0x24
>
>stack backtrace:
> [<c0405812>] show_trace_log_lvl+0x1a/0x2f
> [<c0405db2>] show_trace+0x12/0x14
> [<c0405e36>] dump_stack+0x16/0x18
> [<c043bd84>] __lock_acquire+0x116/0xa09
> [<c043c960>] lock_acquire+0x56/0x6f
> [<c05fb1fa>] __mutex_lock_slowpath+0xe5/0x24a
> [<c05fb380>] mutex_lock+0x21/0x24
> [<c04d82fb>] blkdev_ioctl+0x600/0x76d
> [<c04946b1>] block_ioctl+0x1b/0x1f
> [<c047ed5a>] do_ioctl+0x22/0x68
> [<c047eff2>] vfs_ioctl+0x252/0x265
> [<c047f04e>] sys_ioctl+0x49/0x63
> [<c0404070>] syscall_call+0x7/0xb
Annotate BLKPG_DEL_PARTITION's bd_mutex locking and add a little comment
clarifying the bd_mutex locking, because I confused myself and initially
thought the lock order was wrong too.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | block/ioctl.c | 2 | ||||
-rw-r--r-- | fs/block_dev.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/block/ioctl.c b/block/ioctl.c index e3f5eb9882cf..e06dbe9bc858 100644 --- a/block/ioctl.c +++ b/block/ioctl.c | |||
@@ -82,7 +82,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user | |||
82 | fsync_bdev(bdevp); | 82 | fsync_bdev(bdevp); |
83 | invalidate_bdev(bdevp, 0); | 83 | invalidate_bdev(bdevp, 0); |
84 | 84 | ||
85 | mutex_lock(&bdev->bd_mutex); | 85 | mutex_lock_nested(&bdev->bd_mutex, 1); |
86 | delete_partition(disk, part); | 86 | delete_partition(disk, part); |
87 | mutex_unlock(&bdev->bd_mutex); | 87 | mutex_unlock(&bdev->bd_mutex); |
88 | mutex_unlock(&bdevp->bd_mutex); | 88 | mutex_unlock(&bdevp->bd_mutex); |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 0c59b703e9d5..575076c018f4 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1101,6 +1101,13 @@ static int __blkdev_get(struct block_device *bdev, mode_t mode, unsigned flags, | |||
1101 | int for_part); | 1101 | int for_part); |
1102 | static int __blkdev_put(struct block_device *bdev, int for_part); | 1102 | static int __blkdev_put(struct block_device *bdev, int for_part); |
1103 | 1103 | ||
1104 | /* | ||
1105 | * bd_mutex locking: | ||
1106 | * | ||
1107 | * mutex_lock(part->bd_mutex) | ||
1108 | * mutex_lock_nested(whole->bd_mutex, 1) | ||
1109 | */ | ||
1110 | |||
1104 | static int do_open(struct block_device *bdev, struct file *file, int for_part) | 1111 | static int do_open(struct block_device *bdev, struct file *file, int for_part) |
1105 | { | 1112 | { |
1106 | struct module *owner = NULL; | 1113 | struct module *owner = NULL; |