[PATCH] lockdep: use mutex_lock_nested for bd_mutex to avoid lockdep warning
Now that the nesting in blkdev_{get,put} is simpler, adding mutex_lock_nested
is trivial.
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 19f5f15..846f32d 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -920,7 +920,7 @@
}
owner = disk->fops->owner;
- mutex_lock(&bdev->bd_mutex);
+ mutex_lock_nested(&bdev->bd_mutex, for_part);
if (!bdev->bd_openers) {
bdev->bd_disk = disk;
bdev->bd_contains = bdev;
@@ -1062,7 +1062,7 @@
struct gendisk *disk = bdev->bd_disk;
struct block_device *victim = NULL;
- mutex_lock(&bdev->bd_mutex);
+ mutex_lock_nested(&bdev->bd_mutex, for_part);
lock_kernel();
if (for_part)
bdev->bd_part_count--;