All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Farnum <greg@inktank.com>
To: Alex Elder <elder@inktank.com>, Sage Weil <sage@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] rbd: fix the memory leak of bio_chain_clone
Date: Mon, 2 Jul 2012 11:39:24 -0700	[thread overview]
Message-ID: <CAPYLRzhHiEPRm_zU-f_yzbZ72c6H--8NXh39zzCNurBVyHn35Q@mail.gmail.com> (raw)
In-Reply-To: <1340609863-10971-1-git-send-email-gzhao@suse.com>

Hey guys,
I'm checking through the archives and I didn't see any replies to this
patch, nor does it appear in our tree that I can see. We should
probably let him know what we're doing with it. :)
-Greg

On Mon, Jun 25, 2012 at 12:37 AM, Guangliang Zhao <gzhao@suse.com> wrote:
> Signed-off-by: Guangliang Zhao <gzhao@suse.com>
> ---
>  drivers/block/rbd.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 65665c9..3d6dfc8 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -719,8 +719,6 @@ static struct bio *bio_chain_clone(struct bio **old, struct bio **next,
>                         goto err_out;
>
>                 if (total + old_chain->bi_size > len) {
> -                       struct bio_pair *bp;
> -
>                         /*
>                          * this split can only happen with a single paged bio,
>                          * split_bio will BUG_ON if this is not the case
> @@ -732,13 +730,13 @@ static struct bio *bio_chain_clone(struct bio **old, struct bio **next,
>
>                         /* split the bio. We'll release it either in the next
>                            call, or it will have to be released outside */
> -                       bp = bio_split(old_chain, (len - total) / SECTOR_SIZE);
> -                       if (!bp)
> +                       *bp = bio_split(old_chain, (len - total) / SECTOR_SIZE);
> +                       if (!*bp)
>                                 goto err_out;
>
> -                       __bio_clone(tmp, &bp->bio1);
> +                       __bio_clone(tmp, &(*bp)->bio1);
>
> -                       *next = &bp->bio2;
> +                       *next = &(*bp)->bio2;
>                 } else {
>                         __bio_clone(tmp, old_chain);
>                         *next = old_chain->bi_next;
> --
> 1.7.3.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-07-02 18:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25  7:37 [PATCH] rbd: fix the memory leak of bio_chain_clone Guangliang Zhao
2012-07-02 18:39 ` Gregory Farnum [this message]
2012-07-02 22:48 ` Yehuda Sadeh
2012-07-03 15:31   ` Guangliang Zhao
2012-07-04  3:09   ` Guangliang Zhao
2012-07-11 12:34 Guangliang Zhao
2012-07-17 20:18 ` Yehuda Sadeh
2012-07-19 13:45   ` Guangliang Zhao

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=CAPYLRzhHiEPRm_zU-f_yzbZ72c6H--8NXh39zzCNurBVyHn35Q@mail.gmail.com \
    --to=greg@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=elder@inktank.com \
    --cc=sage@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.