[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9hscRtPa76fdank@slm.duckdns.org>
Date: Mon, 17 Mar 2025 08:39:45 -1000
From: Tejun Heo <tj@...nel.org>
To: Chen Linxuan <chenlinxuan@...ontech.com>
Cc: Josef Bacik <josef@...icpanda.com>, Jens Axboe <axboe@...nel.dk>,
Wen Tao <wentao@...ontech.com>, cgroups@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND v2] blk-cgroup: improve policy registration error
handling
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@...ontech.com>
> Signed-off-by: Wen Tao <wentao@...ontech.com>
> Signed-off-by: Chen Linxuan <chenlinxuan@...ontech.com>
Acked-by: Tejun Heo <tj@...nel.org>
Thanks.
--
tejun
Powered by blists - more mailing lists