rbd: be more informative on -ENOENT failures
pr_info what exactly was the culprit: missing pool, image or snap. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
57e95460f0
commit
1fe480235a
|
@ -5301,9 +5301,14 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
|
|||
|
||||
if (mapping) {
|
||||
ret = rbd_dev_header_watch_sync(rbd_dev);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
if (ret == -ENOENT)
|
||||
pr_info("image %s/%s does not exist\n",
|
||||
rbd_dev->spec->pool_name,
|
||||
rbd_dev->spec->image_name);
|
||||
goto out_header_name;
|
||||
}
|
||||
}
|
||||
|
||||
ret = rbd_dev_header_info(rbd_dev);
|
||||
if (ret)
|
||||
|
@ -5319,8 +5324,14 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping)
|
|||
ret = rbd_spec_fill_snap_id(rbd_dev);
|
||||
else
|
||||
ret = rbd_spec_fill_names(rbd_dev);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
if (ret == -ENOENT)
|
||||
pr_info("snap %s/%s@%s does not exist\n",
|
||||
rbd_dev->spec->pool_name,
|
||||
rbd_dev->spec->image_name,
|
||||
rbd_dev->spec->snap_name);
|
||||
goto err_out_probe;
|
||||
}
|
||||
|
||||
if (rbd_dev->header.features & RBD_FEATURE_LAYERING) {
|
||||
ret = rbd_dev_v2_parent_info(rbd_dev);
|
||||
|
@ -5390,8 +5401,11 @@ static ssize_t do_rbd_add(struct bus_type *bus,
|
|||
|
||||
/* pick the pool */
|
||||
rc = rbd_add_get_pool_id(rbdc, spec->pool_name);
|
||||
if (rc < 0)
|
||||
if (rc < 0) {
|
||||
if (rc == -ENOENT)
|
||||
pr_info("pool %s does not exist\n", spec->pool_name);
|
||||
goto err_out_client;
|
||||
}
|
||||
spec->pool_id = (u64)rc;
|
||||
|
||||
/* The ceph file layout needs to fit pool id in 32 bits */
|
||||
|
|
Loading…
Reference in New Issue