From: Ryan Harper <ryanh@us.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Mike Snitzer <snitzer@redhat.com>, Ryan Harper <ryanh@us.ibm.com>,
Tejun Heo <tj@kernel.org>, Mikulas Patocka <mpatocka@redhat.com>,
dm-devel@redhat.com, Vivek Goyal <vgoyal@redhat.com>,
john.cooper@redhat.com, rusty@rustcorp.com.au,
kvm@vger.kernel.org
Subject: Re: [PATCH] virtio-blk: put request that was created to retrieve the device id
Date: Fri, 17 Sep 2010 09:58:48 -0500 [thread overview]
Message-ID: <20100917145848.GK30086@us.ibm.com> (raw)
In-Reply-To: <20100909211504.GA24506@infradead.org>
* Christoph Hellwig <hch@infradead.org> [2010-09-09 16:18]:
> On Thu, Sep 09, 2010 at 05:00:42PM -0400, Mike Snitzer wrote:
> > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> > index 1260628..831e75c 100644
> > --- a/drivers/block/virtio_blk.c
> > +++ b/drivers/block/virtio_blk.c
> > @@ -199,6 +199,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
> > struct virtio_blk *vblk = disk->private_data;
> > struct request *req;
> > struct bio *bio;
> > + int err;
> >
> > bio = bio_map_kern(vblk->disk->queue, id_str, VIRTIO_BLK_ID_BYTES,
> > GFP_KERNEL);
> > @@ -212,7 +213,10 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
> > }
> >
> > req->cmd_type = REQ_TYPE_SPECIAL;
> > - return blk_execute_rq(vblk->disk->queue, vblk->disk, req, false);
> > + err = blk_execute_rq(vblk->disk->queue, vblk->disk, req, false);
> > + blk_put_request(req);
>
> This looks correct as far as the request is concerned, but we're still
> leaking the bio.
Since __bio_map_kern() sets up bio->bi_end_io = bio_map_kern_endio
(which does a bio_put(bio)) doesn't that ensure we don't leak?
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com
next prev parent reply other threads:[~2010-09-17 14:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100902032246.GA31484@redhat.com>
2010-09-09 15:26 ` [REGRESSION][BISECTED] virtio-blk serial attribute causes guest to hang [Was: Re: [PATCH UPDATED 4/5] dm: implement REQ_FLUSH/FUA support for request-based dm] Mike Snitzer
2010-09-09 15:44 ` Ryan Harper
2010-09-09 15:57 ` Mike Snitzer
2010-09-09 16:03 ` Ryan Harper
2010-09-09 17:55 ` Mike Snitzer
2010-09-09 18:35 ` Ryan Harper
2010-09-09 19:15 ` Mike Snitzer
2010-09-09 19:43 ` Mike Snitzer
2010-09-09 20:14 ` Mike Snitzer
2010-09-09 20:30 ` Ryan Harper
2010-09-09 21:00 ` [PATCH] virtio-blk: put request that was created to retrieve the device id Mike Snitzer
2010-09-09 21:15 ` Christoph Hellwig
2010-09-17 14:58 ` Ryan Harper [this message]
2010-09-21 21:00 ` Christoph Hellwig
2010-10-08 16:06 ` [2.6.36 REGRESSION] " Mike Snitzer
2010-10-09 1:41 ` [PATCH] " Rusty Russell
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=20100917145848.GK30086@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=dm-devel@redhat.com \
--cc=hch@infradead.org \
--cc=john.cooper@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=snitzer@redhat.com \
--cc=tj@kernel.org \
--cc=vgoyal@redhat.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