CEPH filesystem development
 help / color / mirror / Atom feed
From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH REPOST 4/4] rbd: add warnings to rbd_dev_probe_update_spec()
Date: Thu, 17 Jan 2013 09:39:02 -0800	[thread overview]
Message-ID: <50F83736.1000006@inktank.com> (raw)
In-Reply-To: <50E5D816.9010104@inktank.com>

On 01/03/2013 11:12 AM, Alex Elder wrote:
> 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.

The pool could be deleted without us knowing after
our first check.

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
>   drivers/block/rbd.c |    9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index ce6c0cb..530a121 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;
>   	}
>


      reply	other threads:[~2013-01-17 17:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03 19:10 [PATCH REPOST 0/4] rbd: add warnings Alex Elder
2013-01-03 19:11 ` [PATCH REPOST 1/4] rbd: define and use rbd_warn() Alex Elder
2013-01-04  1:11   ` Dan Mick
2013-01-04 16:22   ` [PATCH, v2] " Alex Elder
2013-01-17 17:33     ` Josh Durgin
2013-01-03 19:11 ` [PATCH REPOST 2/4] rbd: add warning messages for missing arguments Alex Elder
2013-01-04  1:10   ` Dan Mick
2013-01-04 15:24     ` Alex Elder
2013-01-03 19:12 ` [PATCH REPOST 3/4] rbd: add a warning in bio_chain_clone_range() Alex Elder
2013-01-17 17:36   ` Josh Durgin
2013-01-03 19:12 ` [PATCH REPOST 4/4] rbd: add warnings to rbd_dev_probe_update_spec() Alex Elder
2013-01-17 17:39   ` Josh Durgin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50F83736.1000006@inktank.com \
    --to=josh.durgin@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=elder@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox