diff options
author | Alex Elder <elder@inktank.com> | 2013-04-28 23:32:34 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-01 21:20:07 -0700 |
commit | b536f69a3a589113992c32982bf2981c8225c9da (patch) | |
tree | 389599582a07f0e268a0ad4a755027aa1c8319fa | |
parent | 8ad42cd0c002fa278f6d0135e22fcb188e400a28 (diff) |
rbd: set up devices only for mapped images
Stop setting up Linux devices during the image probe operation.
Instead, set up the devices as a separate step after the image
probe, in rbd_add().
A consequence of this is that only mapped images get devices
assigned to them, which is pretty sweet.
This resolves:
http://tracker.ceph.com/issues/4774
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r-- | drivers/block/rbd.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 57e56617e45f..d41f97690343 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4879,10 +4879,6 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev) goto err_out_snaps; ret = rbd_dev_probe_parent(rbd_dev); - if (ret) - goto err_out_snaps; - - ret = rbd_dev_device_setup(rbd_dev); if (!ret) return 0; @@ -4964,9 +4960,12 @@ static ssize_t rbd_add(struct bus_type *bus, if (rc < 0) goto err_out_rbd_dev; - return count; + rc = rbd_dev_device_setup(rbd_dev); + if (!rc) + return count; + + rbd_dev_image_release(rbd_dev); err_out_rbd_dev: - kfree(rbd_dev->header_name); rbd_dev_destroy(rbd_dev); err_out_client: rbd_put_client(rbdc); @@ -5029,7 +5028,6 @@ static void rbd_dev_remove_parent(struct rbd_device *rbd_dev) second = third; } rbd_assert(second); - rbd_bus_del_dev(second); rbd_dev_image_release(second); first->parent = NULL; first->parent_overlap = 0; |