diff options
| author | Chen Linxuan <[email protected]> | 2025-03-17 02:29:24 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2025-03-18 18:32:09 +0000 |
| commit | e1a0202c6bfda24002a3ae2115154fa90104c649 (patch) | |
| tree | de891e9323369bbfc8f266ae784b884f1390b1f4 /net/unix/unix_bpf.c | |
| parent | loop: move vfs_fsync() out of loop_update_dio() (diff) | |
| download | kernel-e1a0202c6bfda24002a3ae2115154fa90104c649.tar.gz kernel-e1a0202c6bfda24002a3ae2115154fa90104c649.zip | |
blk-cgroup: improve policy registration error handling
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 <[email protected]>
Signed-off-by: Wen Tao <[email protected]>
Signed-off-by: Chen Linxuan <[email protected]>
Reviewed-by: Michal Koutný <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Reviewed-by: Yu Kuai <[email protected]>
Link: https://lore.kernel.org/r/3E333A73B6B6DFC0+20250317022924.150907-1-chenlinxuan@uniontech.com
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'net/unix/unix_bpf.c')
0 files changed, 0 insertions, 0 deletions
