linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Tejun Heo <tj@kernel.org>, Julia Lawall <julia.lawall@lip6.fr>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	kernel-team@fb.com, linux-block@vger.kernel.org
Subject: Re: [PATCH block/for-linus] blkcg: fix botched pd_prealloc error handling in blkcg_activate_policy()
Date: Tue, 15 Oct 2019 09:52:12 -0600	[thread overview]
Message-ID: <07cbc404-65db-b236-9ae2-558197b8cdb6@kernel.dk> (raw)
In-Reply-To: <20191015154827.GK18794@devbig004.ftw2.facebook.com>

On 10/15/19 9:48 AM, Tejun Heo wrote:
> While fixing ->pd_alloc_fn() bug, ab94b0382d81 ("blkcg: Fix
> ->pd_alloc_fn() being called with the wrong blkcg on policy
> activation") broke the pd_prealloc error handling.
> 
> * pd's were freed using kfree().  They should be freed with
>    ->pd_free_fn().
> 
> * pd_prealloc could be kfree()'d and then ->pd_free_fn()'d again.
> 
> * When GFP_KERNEL allocation fails, pinned_blkg wasn't put.
> 
> There are also a couple existing issues.
> 
> * Each pd is initialized as they get allocated.  If alloc fails, the
>    policy will get freed with pd's initialized on it.
> 
> * After the above partial failure, the partial pds are not freed.
> 
> This patch fixes all of the above issues.

I dropped the other one, do you mind sending a folded patch?

-- 
Jens Axboe


  reply	other threads:[~2019-10-15 15:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.21.1910151232480.2818@hadrien>
2019-10-15 15:48 ` [PATCH block/for-linus] blkcg: fix botched pd_prealloc error handling in blkcg_activate_policy() Tejun Heo
2019-10-15 15:52   ` Jens Axboe [this message]
2019-10-15 16:03     ` [PATCH block/for-linus] blkcg: Fix multiple bugs " Tejun Heo
2019-10-15 16:13       ` Jens Axboe

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=07cbc404-65db-b236-9ae2-558197b8cdb6@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=julia.lawall@lip6.fr \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).