From: Josef Bacik <josef@toxicpanda.com>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Jens Axboe <axboe@fb.com>, Josef Bacik <josef@toxicpanda.com>,
Josef Bacik <jbacik@fb.com>,
nbd-general@lists.sourceforge.net, linux-block@vger.kernel.org
Subject: Re: [PATCH] nbd: don't leak nbd_config
Date: Tue, 23 May 2017 10:30:29 -0400 [thread overview]
Message-ID: <20170523143029.GA3915@destiny> (raw)
In-Reply-To: <CAOi1vP-MEe6deZzwHt1btXALrDshwcxM79ZrG0uaGd1wRV_xWA@mail.gmail.com>
On Tue, May 23, 2017 at 04:27:56PM +0200, Ilya Dryomov wrote:
> On Tue, May 23, 2017 at 4:16 PM, Jens Axboe <axboe@fb.com> wrote:
> > On 05/23/2017 08:14 AM, Josef Bacik wrote:
> >> On Tue, May 23, 2017 at 12:38:31PM +0200, Ilya Dryomov wrote:
> >>> nbd_config is allocated in nbd_alloc_config(), but never freed.
> >>>
> >>> Fixes: 5ea8d10802ec ("nbd: separate out the config information")
> >>> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
> >>> ---
> >>> drivers/block/nbd.c | 1 +
> >>> 1 file changed, 1 insertion(+)
> >>>
> >>
> >> Oops, thanks Ilya
> >>
> >> Reviewed-by: Josef Bacik <jbacik@fb.com>
> >
> > Since config is referenced, why isn't this done in nbd_config_put()
> > instead?
>
> Josef's 5ea8d10802ec added that nbd->config = NULL to nbd_reset(), so
> I followed his lead. It could be done nbd_config_put() -- nbd_reset()
> call in nbd_dev_add() looks like a no-op to me. Josef?
>
Yeah it used to be called more, but when I moved the config to be ref counted it
lost it's old uses and I just didn't notice enough to delete it. Just fold that
into nbd_config_put() and call it a day. Thanks,
Josef
prev parent reply other threads:[~2017-05-23 14:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 10:38 [PATCH] nbd: don't leak nbd_config Ilya Dryomov
2017-05-23 14:14 ` Josef Bacik
2017-05-23 14:16 ` Jens Axboe
2017-05-23 14:27 ` Ilya Dryomov
2017-05-23 14:30 ` Josef Bacik [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=20170523143029.GA3915@destiny \
--to=josef@toxicpanda.com \
--cc=axboe@fb.com \
--cc=idryomov@gmail.com \
--cc=jbacik@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=nbd-general@lists.sourceforge.net \
/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