rbd: set the 'device' link in sysfs
authorHannes Reinecke <hare@suse.de>
Thu, 23 Jan 2020 12:44:33 +0000 (13:44 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 27 Jan 2020 15:53:40 +0000 (16:53 +0100)
The rbd driver already provides additional information in sysfs
under /sys/bus/rbd, so we should set the 'device' link in the block
device to reference this information.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c

index 38dcb39..405b66e 100644 (file)
@@ -7143,7 +7143,7 @@ static ssize_t do_rbd_add(struct bus_type *bus,
        if (rc)
                goto err_out_image_lock;
 
-       add_disk(rbd_dev->disk);
+       device_add_disk(&rbd_dev->dev, rbd_dev->disk, NULL);
        /* see rbd_init_disk() */
        blk_put_queue(rbd_dev->disk->queue);