Skip to content

knet_manager: fix deadlock on port creation#486

Merged
ideaship merged 1 commit intomainfrom
jogo_knet_fix_locking
Feb 4, 2026
Merged

knet_manager: fix deadlock on port creation#486
ideaship merged 1 commit intomainfrom
jogo_knet_fix_locking

Conversation

@KanjiMonster
Copy link
Contributor

@KanjiMonster KanjiMonster commented Feb 4, 2026

When creating ports in knet_manager::create_portdev(), they are created with tn_mutex held, and it calls knet_manager::change_port_status() to set the initial config to down.

Since commit cefce26 ("knet_manager: do not try to set state for non-existing links"), knet_manager::change_port_status() also takes the mutex, leading to a deadlock on port creation.

Fix this by providing a non-locking variant of
knet_manager::change_port_status() to use by
knet_manager::create_portdev().

Fixes: cefce26 ("knet_manager: do not try to set state for non-existing links")

When creating ports in knet_manager::create_portdev(), they are created
with tn_mutex held, and calls knet_manager::change_port_status() to set
the initial config to down.

Since commit cefce26 ("knet_manager: do not try to set state for
non-existing links"), knet_manager::change_port_status() also takes the
mutex, leading to a deadlock on port creation.

Fix this by providing a non-locking variant of
knet_manager::change_port_status() to use by
knet_manager::create_portdev().

Fixes: cefce26 ("knet_manager: do not try to set state for non-existing links")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
Copy link
Contributor

@ideaship ideaship left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ideaship ideaship merged commit 03fe7d0 into main Feb 4, 2026
4 checks passed
@ideaship ideaship deleted the jogo_knet_fix_locking branch February 4, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants