static int rbd_dev_probe_finish(struct rbd_device *rbd_dev)
{
int ret;
- int tmp;
-
- ret = rbd_dev_header_watch_sync(rbd_dev, 1);
- if (ret)
- return ret;
ret = rbd_dev_mapping_set(rbd_dev);
if (ret)
unregister_blkdev(rbd_dev->major, rbd_dev->name);
err_out_id:
rbd_dev_id_put(rbd_dev);
- tmp = rbd_dev_header_watch_sync(rbd_dev, 0);
- if (tmp)
- rbd_warn(rbd_dev, "failed to cancel watch event (%d)\n", ret);
rbd_dev_mapping_clear(rbd_dev);
return ret;
static int rbd_dev_image_probe(struct rbd_device *rbd_dev)
{
int ret;
+ int tmp;
/*
* Get the id from the image id object. If it's not a
if (ret)
goto err_out_format;
+ ret = rbd_dev_header_watch_sync(rbd_dev, 1);
+ if (ret)
+ goto out_header_name;
+
if (rbd_dev->image_format == 1)
ret = rbd_dev_v1_probe(rbd_dev);
else
ret = rbd_dev_v2_probe(rbd_dev);
if (ret)
- goto out_header_name;
+ goto err_out_watch;
ret = rbd_dev_snaps_update(rbd_dev);
if (ret)
- goto out_header_name;
+ goto err_out_watch;
ret = rbd_dev_spec_update(rbd_dev);
if (ret)
rbd_header_free(&rbd_dev->header);
err_out_snaps:
rbd_remove_all_snaps(rbd_dev);
+err_out_watch:
+ tmp = rbd_dev_header_watch_sync(rbd_dev, 0);
+ if (tmp)
+ rbd_warn(rbd_dev, "unable to tear down watch request\n");
out_header_name:
kfree(rbd_dev->header_name);
rbd_dev->header_name = NULL;