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 3/4] rbd: add a warning in bio_chain_clone_range()
Date: Thu, 17 Jan 2013 09:36:01 -0800	[thread overview]
Message-ID: <50F83681.3070503@inktank.com> (raw)
In-Reply-To: <50E5D807.6040300@inktank.com>

On 01/03/2013 11:12 AM, Alex Elder wrote:
> Add a warning in bio_chain_clone_range() to help a user determine
> what exactly might have led to a failure.  There is only one; please
> say something if you disagree with the following reasoning.
>
> There are three places this can return abnormally:
>      - Initially, if there is nothing to clone.  It turns out that
>        right now this cannot happen anyway.  The test is in place
>        because the code below it doesn't work if those conditions
>        don't hold.  As such they could be assertions but since I can
>        return a null to indicate an error I just do that instead.
>        I have not added a warning here because it won't happen.
>      - While processing bio's, if none remain but there are supposed
>        to be more bytes to clone.  Here I have added a warning.
>      - If bio_clone_range() returns a null pointer.  That function
>        will have already produced a warning (at least the first
>        time, via WARN_ON_ONCE()) to distinguish the cause of the
>        error.  The only exception is memory exhaustion, and I'd
>        rather not pepper the code with warnings in all those spots.
>        So no warning is added in that place.
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---

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

>   drivers/block/rbd.c |    4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 31da8c5..ce6c0cb 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -993,8 +993,10 @@ static struct bio *bio_chain_clone_range(struct bio
> **bio_src,
>   		unsigned int bi_size;
>   		struct bio *bio;
>
> -		if (!bi)
> +		if (!bi) {
> +			rbd_warn(NULL, "bio_chain exhausted with %u left", len);
>   			goto out_err;	/* EINVAL; ran out of bio's */
> +		}
>   		bi_size = min_t(unsigned int, bi->bi_size - off, len);
>   		bio = bio_clone_range(bi, off, bi_size, gfpmask);
>   		if (!bio)
>


  reply	other threads:[~2013-01-17 17:36 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 [this message]
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=50F83681.3070503@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