summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2015-03-05 10:47:22 +0300
committerIlya Dryomov <idryomov@gmail.com>2015-04-20 18:55:33 +0300
commit1fe480235ad7236e8ea6c167af5a5d1ac24f8a88 (patch)
tree3bd32d7d754f11e00c8df29e97377c1aac6b1fac /drivers/block
parent57e95460f0b360c4d29c0320922b46b55dd2b79f (diff)
downloadlwn-1fe480235ad7236e8ea6c167af5a5d1ac24f8a88.tar.gz
lwn-1fe480235ad7236e8ea6c167af5a5d1ac24f8a88.zip
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>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index b40af3203089..83f5733f1a7a 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -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 */