rbd: be more informative on -ENOENT failures
authorIlya Dryomov <idryomov@gmail.com>
Thu, 5 Mar 2015 07:47:22 +0000 (10:47 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 20 Apr 2015 15:55:33 +0000 (18:55 +0300)
pr_info what exactly was the culprit: missing pool, image or snap.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c

index b40af3203089c846db053dfac879567230509299..83f5733f1a7a274ea644885afb54a69fe4331d51 100644 (file)
@@ -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 */