Re: [PATCH block/for-linus] blkcg: fix botched pd_prealloc error handling in blkcg_activate_policy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux