diff options
-rw-r--r-- | fs/block_dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 19f5f153ddb8..846f32d51be7 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -920,7 +920,7 @@ static int do_open(struct block_device *bdev, struct file *file, int for_part) | |||
920 | } | 920 | } |
921 | owner = disk->fops->owner; | 921 | owner = disk->fops->owner; |
922 | 922 | ||
923 | mutex_lock(&bdev->bd_mutex); | 923 | mutex_lock_nested(&bdev->bd_mutex, for_part); |
924 | if (!bdev->bd_openers) { | 924 | if (!bdev->bd_openers) { |
925 | bdev->bd_disk = disk; | 925 | bdev->bd_disk = disk; |
926 | bdev->bd_contains = bdev; | 926 | bdev->bd_contains = bdev; |
@@ -1062,7 +1062,7 @@ static int __blkdev_put(struct block_device *bdev, int for_part) | |||
1062 | struct gendisk *disk = bdev->bd_disk; | 1062 | struct gendisk *disk = bdev->bd_disk; |
1063 | struct block_device *victim = NULL; | 1063 | struct block_device *victim = NULL; |
1064 | 1064 | ||
1065 | mutex_lock(&bdev->bd_mutex); | 1065 | mutex_lock_nested(&bdev->bd_mutex, for_part); |
1066 | lock_kernel(); | 1066 | lock_kernel(); |
1067 | if (for_part) | 1067 | if (for_part) |
1068 | bdev->bd_part_count--; | 1068 | bdev->bd_part_count--; |