Commit fd27c7a1 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds
Browse files

[PATCH] lockdep: remove lock_key approach to managing nested bd_mutex locks

The extra call to get_gendisk is not good.  It causes a ->probe and possible
module load before it is really appropriate to do this.

Cc: Ingo Molnar <>
Acked-by: default avatarPeter Zijlstra <>
Signed-off-by: default avatarNeil Brown <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 35a6027f
......@@ -355,14 +355,10 @@ static int bdev_set(struct inode *inode, void *data)
static LIST_HEAD(all_bdevs);
static struct lock_class_key bdev_part_lock_key;
struct block_device *bdget(dev_t dev)
struct block_device *bdev;
struct inode *inode;
struct gendisk *disk;
int part = 0;
inode = iget5_locked(bd_mnt->mnt_sb, hash(dev),
bdev_test, bdev_set, &dev);
......@@ -388,11 +384,6 @@ struct block_device *bdget(dev_t dev)
list_add(&bdev->bd_list, &all_bdevs);
disk = get_gendisk(dev, &part);
if (part)
lockdep_set_class(&bdev->bd_mutex, &bdev_part_lock_key);
return bdev;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment