Commit 1fe48023 authored by Ilya Dryomov's avatar Ilya Dryomov

rbd: be more informative on -ENOENT failures

pr_info what exactly was the culprit: missing pool, image or snap.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 57e95460
......@@ -5301,8 +5301,13 @@ 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);
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment