There's no need to set the size/features for a mapped device until we're about to make it available for use. So wait until then to do it. Signed-off-by: Alex Elder <elder@xxxxxxxxxxx> --- drivers/block/rbd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 12bc89f..b10348c 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4712,10 +4712,6 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) if (ret) goto err_out_snaps; - ret = rbd_dev_set_mapping(rbd_dev); - if (ret) - goto err_out_snaps; - /* generate unique id: find highest unique id, add one */ rbd_dev_id_get(rbd_dev); @@ -4774,10 +4770,15 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) if (ret) goto err_out_bus; - /* Everything's ready. Announce the disk to the world. */ + ret = rbd_dev_set_mapping(rbd_dev); + if (ret) + goto err_out_bus; set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE); set_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags); + + /* Everything's ready. Announce the disk to the world. */ + add_disk(rbd_dev->disk); pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name, -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html