diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2015-03-05 02:47:22 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-04-20 11:55:33 -0400 |
commit | 1fe480235ad7236e8ea6c167af5a5d1ac24f8a88 (patch) | |
tree | 3bd32d7d754f11e00c8df29e97377c1aac6b1fac /drivers/block | |
parent | 57e95460f0b360c4d29c0320922b46b55dd2b79f (diff) |
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.c | 20 |
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) | |||
5301 | 5301 | ||
5302 | if (mapping) { | 5302 | if (mapping) { |
5303 | ret = rbd_dev_header_watch_sync(rbd_dev); | 5303 | ret = rbd_dev_header_watch_sync(rbd_dev); |
5304 | if (ret) | 5304 | if (ret) { |
5305 | if (ret == -ENOENT) | ||
5306 | pr_info("image %s/%s does not exist\n", | ||
5307 | rbd_dev->spec->pool_name, | ||
5308 | rbd_dev->spec->image_name); | ||
5305 | goto out_header_name; | 5309 | goto out_header_name; |
5310 | } | ||
5306 | } | 5311 | } |
5307 | 5312 | ||
5308 | ret = rbd_dev_header_info(rbd_dev); | 5313 | ret = rbd_dev_header_info(rbd_dev); |
@@ -5319,8 +5324,14 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping) | |||
5319 | ret = rbd_spec_fill_snap_id(rbd_dev); | 5324 | ret = rbd_spec_fill_snap_id(rbd_dev); |
5320 | else | 5325 | else |
5321 | ret = rbd_spec_fill_names(rbd_dev); | 5326 | ret = rbd_spec_fill_names(rbd_dev); |
5322 | if (ret) | 5327 | if (ret) { |
5328 | if (ret == -ENOENT) | ||
5329 | pr_info("snap %s/%s@%s does not exist\n", | ||
5330 | rbd_dev->spec->pool_name, | ||
5331 | rbd_dev->spec->image_name, | ||
5332 | rbd_dev->spec->snap_name); | ||
5323 | goto err_out_probe; | 5333 | goto err_out_probe; |
5334 | } | ||
5324 | 5335 | ||
5325 | if (rbd_dev->header.features & RBD_FEATURE_LAYERING) { | 5336 | if (rbd_dev->header.features & RBD_FEATURE_LAYERING) { |
5326 | ret = rbd_dev_v2_parent_info(rbd_dev); | 5337 | ret = rbd_dev_v2_parent_info(rbd_dev); |
@@ -5390,8 +5401,11 @@ static ssize_t do_rbd_add(struct bus_type *bus, | |||
5390 | 5401 | ||
5391 | /* pick the pool */ | 5402 | /* pick the pool */ |
5392 | rc = rbd_add_get_pool_id(rbdc, spec->pool_name); | 5403 | rc = rbd_add_get_pool_id(rbdc, spec->pool_name); |
5393 | if (rc < 0) | 5404 | if (rc < 0) { |
5405 | if (rc == -ENOENT) | ||
5406 | pr_info("pool %s does not exist\n", spec->pool_name); | ||
5394 | goto err_out_client; | 5407 | goto err_out_client; |
5408 | } | ||
5395 | spec->pool_id = (u64)rc; | 5409 | spec->pool_id = (u64)rc; |
5396 | 5410 | ||
5397 | /* The ceph file layout needs to fit pool id in 32 bits */ | 5411 | /* The ceph file layout needs to fit pool id in 32 bits */ |