All of lore.kernel.org
 help / color / mirror / Atom feed
From: weiping zhang <zwp10758@gmail.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH] blkcg: check pol->cpd_free_fn before free cpd
Date: Tue, 10 Oct 2017 23:44:17 +0800	[thread overview]
Message-ID: <20171010154417.GA38613@localhost.didichuxing.com> (raw)
In-Reply-To: <e161a324-40ba-fac8-d0e0-65b63ea8ceaf@kernel.dk>

On Tue, Oct 10, 2017 at 09:04:39AM -0600, Jens Axboe wrote:
> On 10/10/2017 08:53 AM, weiping zhang wrote:
> > check pol->cpd_free_fn() instead of pol->cpd_alloc_fn() when free cpd.
> 
> In practice this shouldn't make a difference, since if you have an
> alloc_fn, you better also have a free_fn. I'd argue a better
> patch would be ensuring that's the case, since the current situation
> would at least oops and show you there's an issue, but with the patch
> we'll just leak the memory.
> 
> I'll apply it, but would be nice if this was handled a bit more
> proactively.
> 
Thanks your comments, I'll add a sanity check in blkcg_policy_register
function.

  reply	other threads:[~2017-10-10 15:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 14:53 [PATCH] blkcg: check pol->cpd_free_fn before free cpd weiping zhang
2017-10-10 14:59 ` Johannes Thumshirn
2017-10-10 15:04 ` Jens Axboe
2017-10-10 15:44   ` weiping zhang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-29 16:08 weiping zhang

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=20171010154417.GA38613@localhost.didichuxing.com \
    --to=zwp10758@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /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.