diff options
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c index c2223f12a805..96a66f671720 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -671,10 +671,13 @@ void device_add_disk(struct device *parent, struct gendisk *disk) | |||
671 | disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO; | 671 | disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO; |
672 | disk->flags |= GENHD_FL_NO_PART_SCAN; | 672 | disk->flags |= GENHD_FL_NO_PART_SCAN; |
673 | } else { | 673 | } else { |
674 | int ret; | ||
675 | |||
674 | /* Register BDI before referencing it from bdev */ | 676 | /* Register BDI before referencing it from bdev */ |
675 | disk_to_dev(disk)->devt = devt; | 677 | disk_to_dev(disk)->devt = devt; |
676 | bdi_register_owner(disk->queue->backing_dev_info, | 678 | ret = bdi_register_owner(disk->queue->backing_dev_info, |
677 | disk_to_dev(disk)); | 679 | disk_to_dev(disk)); |
680 | WARN_ON(ret); | ||
678 | blk_register_region(disk_devt(disk), disk->minors, NULL, | 681 | blk_register_region(disk_devt(disk), disk->minors, NULL, |
679 | exact_match, exact_lock, disk); | 682 | exact_match, exact_lock, disk); |
680 | } | 683 | } |
@@ -1389,7 +1392,7 @@ struct gendisk *__alloc_disk_node(int minors, int node_id) | |||
1389 | 1392 | ||
1390 | if (minors > DISK_MAX_PARTS) { | 1393 | if (minors > DISK_MAX_PARTS) { |
1391 | printk(KERN_ERR | 1394 | printk(KERN_ERR |
1392 | "block: can't allocated more than %d partitions\n", | 1395 | "block: can't allocate more than %d partitions\n", |
1393 | DISK_MAX_PARTS); | 1396 | DISK_MAX_PARTS); |
1394 | minors = DISK_MAX_PARTS; | 1397 | minors = DISK_MAX_PARTS; |
1395 | } | 1398 | } |