diff options
author | Alex Elder <elder@dreamhost.com> | 2012-11-01 16:17:15 +0100 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-01-17 21:12:46 +0100 |
commit | 935dc89f3e29e2ef1d7c89778cdb9f37ff36e94b (patch) | |
tree | fbafa1643cc38dd3f1af464a16897c40d05c3453 /drivers/block/rbd.c | |
parent | rbd: add a warning in bio_chain_clone_range() (diff) | |
download | linux-935dc89f3e29e2ef1d7c89778cdb9f37ff36e94b.tar.xz linux-935dc89f3e29e2ef1d7c89778cdb9f37ff36e94b.zip |
rbd: add warnings to rbd_dev_probe_update_spec()
Josh suggested adding warnings to this function to help users
diagnose problems.
Other than memory allocatino errors, there are two places where
errors can be returned. Both represent problems that should
have been caught earlier, and as such might well have been
handled with BUG_ON() calls. But if either ever did manage to
happen, it will be reported.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/block/rbd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index ce6c0cbb3d7a..530a1217a0fa 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2644,8 +2644,11 @@ static int rbd_dev_probe_update_spec(struct rbd_device *rbd_dev) osdc = &rbd_dev->rbd_client->client->osdc; name = ceph_pg_pool_name_by_id(osdc->osdmap, rbd_dev->spec->pool_id); - if (!name) - return -EIO; /* pool id too large (>= 2^31) */ + if (!name) { + rbd_warn(rbd_dev, "there is no pool with id %llu", + rbd_dev->spec->pool_id); /* Really a BUG() */ + return -EIO; + } rbd_dev->spec->pool_name = kstrdup(name, GFP_KERNEL); if (!rbd_dev->spec->pool_name) @@ -2663,6 +2666,8 @@ static int rbd_dev_probe_update_spec(struct rbd_device *rbd_dev) name = rbd_snap_name(rbd_dev, rbd_dev->spec->snap_id); if (!name) { + rbd_warn(rbd_dev, "no snapshot with id %llu", + rbd_dev->spec->snap_id); /* Really a BUG() */ ret = -EIO; goto out_err; } |