diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index afe74dda632b..0e575d1304b4 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1139,6 +1139,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1139 | mutex_lock_nested(&bdev->bd_mutex, for_part); | 1139 | mutex_lock_nested(&bdev->bd_mutex, for_part); |
1140 | if (!bdev->bd_openers) { | 1140 | if (!bdev->bd_openers) { |
1141 | bdev->bd_disk = disk; | 1141 | bdev->bd_disk = disk; |
1142 | bdev->bd_queue = disk->queue; | ||
1142 | bdev->bd_contains = bdev; | 1143 | bdev->bd_contains = bdev; |
1143 | if (!partno) { | 1144 | if (!partno) { |
1144 | struct backing_dev_info *bdi; | 1145 | struct backing_dev_info *bdi; |
@@ -1159,6 +1160,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1159 | disk_put_part(bdev->bd_part); | 1160 | disk_put_part(bdev->bd_part); |
1160 | bdev->bd_part = NULL; | 1161 | bdev->bd_part = NULL; |
1161 | bdev->bd_disk = NULL; | 1162 | bdev->bd_disk = NULL; |
1163 | bdev->bd_queue = NULL; | ||
1162 | mutex_unlock(&bdev->bd_mutex); | 1164 | mutex_unlock(&bdev->bd_mutex); |
1163 | disk_unblock_events(disk); | 1165 | disk_unblock_events(disk); |
1164 | put_disk(disk); | 1166 | put_disk(disk); |
@@ -1232,6 +1234,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1232 | disk_put_part(bdev->bd_part); | 1234 | disk_put_part(bdev->bd_part); |
1233 | bdev->bd_disk = NULL; | 1235 | bdev->bd_disk = NULL; |
1234 | bdev->bd_part = NULL; | 1236 | bdev->bd_part = NULL; |
1237 | bdev->bd_queue = NULL; | ||
1235 | bdev_inode_switch_bdi(bdev->bd_inode, &default_backing_dev_info); | 1238 | bdev_inode_switch_bdi(bdev->bd_inode, &default_backing_dev_info); |
1236 | if (bdev != bdev->bd_contains) | 1239 | if (bdev != bdev->bd_contains) |
1237 | __blkdev_put(bdev->bd_contains, mode, 1); | 1240 | __blkdev_put(bdev->bd_contains, mode, 1); |