lkml.org 
[lkml]   [2019]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH block/for-linus] blkcg: fix botched pd_prealloc error handling in blkcg_activate_policy()
From
Date
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

\
 
 \ /
  Last update: 2019-10-15 17:53    [W:0.054 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site