CEPH filesystem development
 help / color / mirror / Atom feed
From: Dan Mick <dan.mick@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Re: [PATCH REPOST 2/4] rbd: add warning messages for missing arguments
Date: Thu, 03 Jan 2013 17:10:40 -0800	[thread overview]
Message-ID: <50E62C10.1010608@inktank.com> (raw)
In-Reply-To: <50E5D7FB.9040906@inktank.com>

Do you want to include in the message some kind of indication which 
operation/function is involved?  (this is definitely better, but even 
better might be to add "rbd add" or "rbd_add_parse_args" to the msgs)

On 01/03/2013 11:11 AM, Alex Elder wrote:
> Tell the user (via dmesg) what was wrong with the arguments provided
> via /sys/bus/rbd/add.
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
>   drivers/block/rbd.c |   24 ++++++++++++++++--------
>   1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 635b81d..31da8c5 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -3244,8 +3244,10 @@ static int rbd_add_parse_args(const char *buf,
>   	/* The first four tokens are required */
>
>   	len = next_token(&buf);
> -	if (!len)
> -		return -EINVAL;	/* Missing monitor address(es) */
> +	if (!len) {
> +		rbd_warn(NULL, "no monitor address(es) provided");
> +		return -EINVAL;
> +	}
>   	mon_addrs = buf;
>   	mon_addrs_size = len + 1;
>   	buf += len;
> @@ -3254,8 +3256,10 @@ static int rbd_add_parse_args(const char *buf,
>   	options = dup_token(&buf, NULL);
>   	if (!options)
>   		return -ENOMEM;
> -	if (!*options)
> -		goto out_err;	/* Missing options */
> +	if (!*options) {
> +		rbd_warn(NULL, "no options provided");
> +		goto out_err;
> +	}
>
>   	spec = rbd_spec_alloc();
>   	if (!spec)
> @@ -3264,14 +3268,18 @@ static int rbd_add_parse_args(const char *buf,
>   	spec->pool_name = dup_token(&buf, NULL);
>   	if (!spec->pool_name)
>   		goto out_mem;
> -	if (!*spec->pool_name)
> -		goto out_err;	/* Missing pool name */
> +	if (!*spec->pool_name) {
> +		rbd_warn(NULL, "no pool name provided");
> +		goto out_err;
> +	}
>
>   	spec->image_name = dup_token(&buf, NULL);
>   	if (!spec->image_name)
>   		goto out_mem;
> -	if (!*spec->image_name)
> -		goto out_err;	/* Missing image name */
> +	if (!*spec->image_name) {
> +		rbd_warn(NULL, "no image name provided");
> +		goto out_err;
> +	}
>
>   	/*
>   	 * Snapshot name is optional; default is to use "-"
>

  reply	other threads:[~2013-01-04  1:10 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 [this message]
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

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=50E62C10.1010608@inktank.com \
    --to=dan.mick@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