diff options
| author | Breno Leitao <leitao@debian.org> | 2026-03-12 09:12:02 -0700 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-03-13 07:36:40 -1000 |
| commit | 1abaae9b38a85c9dabff67a22d8c99f7254c423a (patch) | |
| tree | 1698a937dcdb27ab2383b2908f4a44ef67a84c17 /rust/kernel/interop/git@git.tavy.me:linux-stable.git | |
| parent | b39bf7f0fae98c03e5ba6061e2251eeb36ec0b39 (diff) | |
workqueue: fix parse_affn_scope() prefix matching bug
parse_affn_scope() uses strncasecmp() with the length of the candidate
name, which means it only checks if the input *starts with* a known
scope name.
Given that the upcoming diff will create "cache_shard" affinity scope,
writing "cache_shard" to a workqueue's affinity_scope sysfs attribute
always matches "cache" first, making it impossible to select
"cache_shard" via sysfs, so, this fix enable it to distinguish "cache"
and "cache_shard"
Fix by replacing the hand-rolled prefix matching loop with
sysfs_match_string(), which uses sysfs_streq() for exact matching
(modulo trailing newlines). Also add the missing const qualifier to
the wq_affn_names[] array declaration.
Note that sysfs_streq() is case-sensitive, unlike the previous
strncasecmp() approach. This is intentional and consistent with
how other sysfs attributes handle string matching in the kernel.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'rust/kernel/interop/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
