Message ID | 517BC6AE.3010304@inktank.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c81b319..5fd923f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4751,6 +4751,10 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) if (ret) goto err_out_snaps; + ret = rbd_dev_probe_parent(rbd_dev); + if (ret) + goto err_out_snaps; + /* generate unique id: find highest unique id, add one */ rbd_dev_id_get(rbd_dev);
Probe for a parent device earlier in rbd_dev_probe_finish(), before starting to set up the Linux side of the rbd device. Signed-off-by: Alex Elder <elder@inktank.com> --- drivers/block/rbd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) @@ -4781,10 +4785,6 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) * of the sysfs code (initiated by rbd_bus_del_dev()). */ - ret = rbd_dev_probe_parent(rbd_dev); - if (ret) - goto err_out_bus; - ret = rbd_dev_header_watch_sync(rbd_dev, 1); if (ret) goto err_out_bus; @@ -4806,8 +4806,6 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) return ret; err_out_bus: - if (rbd_dev->parent) - rbd_dev_remove_parent(rbd_dev); rbd_bus_del_dev(rbd_dev); return ret; @@ -4817,6 +4815,8 @@ err_out_blkdev: unregister_blkdev(rbd_dev->major, rbd_dev->name); err_out_id: rbd_dev_id_put(rbd_dev); + if (rbd_dev->parent); + rbd_dev_remove_parent(rbd_dev); err_out_snaps: rbd_remove_all_snaps(rbd_dev);