Commit 6796bf54a64df36f96a42ae222423fffe36c58a5
Committed by
Linus Torvalds
1 parent
37be41241f
Exists in
master
and in
4 other branches
[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>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
fs/block_dev.c
... | ... | @@ -920,7 +920,7 @@ |
920 | 920 | } |
921 | 921 | owner = disk->fops->owner; |
922 | 922 | |
923 | - mutex_lock(&bdev->bd_mutex); | |
923 | + mutex_lock_nested(&bdev->bd_mutex, for_part); | |
924 | 924 | if (!bdev->bd_openers) { |
925 | 925 | bdev->bd_disk = disk; |
926 | 926 | bdev->bd_contains = bdev; |
... | ... | @@ -1062,7 +1062,7 @@ |
1062 | 1062 | struct gendisk *disk = bdev->bd_disk; |
1063 | 1063 | struct block_device *victim = NULL; |
1064 | 1064 | |
1065 | - mutex_lock(&bdev->bd_mutex); | |
1065 | + mutex_lock_nested(&bdev->bd_mutex, for_part); | |
1066 | 1066 | lock_kernel(); |
1067 | 1067 | if (for_part) |
1068 | 1068 | bdev->bd_part_count--; |