Re: [PATCH RESEND v2] blk-cgroup: improve policy registration error handling

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

 



On Mon, Mar 17, 2025 at 10:29:24AM +0800, Chen Linxuan wrote:
> This patch improve the returned error code of blkcg_policy_register().
> 
> 1. Move the validation check for cpd/pd_alloc_fn and cpd/pd_free_fn
>    function pairs to the start of blkcg_policy_register(). This ensures
>    we immediately return -EINVAL if the function pairs are not correctly
>    provided, rather than returning -ENOSPC after locking and unlocking
>    mutexes unnecessarily.
> 
>    Those locks should not contention any problems, as error of policy
>    registration is a super cold path.
> 
> 2. Return -ENOMEM when cpd_alloc_fn() failed.
> 
> Co-authored-by: Wen Tao <wentao@xxxxxxxxxxxxx>
> Signed-off-by: Wen Tao <wentao@xxxxxxxxxxxxx>
> Signed-off-by: Chen Linxuan <chenlinxuan@xxxxxxxxxxxxx>

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

-- 
tejun




[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