Skip to content

Drop OPTE port lock earlier#10281

Merged
bnaecker merged 2 commits intomainfrom
ben/drop-opte-lock-before-returning
Apr 17, 2026
Merged

Drop OPTE port lock earlier#10281
bnaecker merged 2 commits intomainfrom
ben/drop-opte-lock-before-returning

Conversation

@bnaecker
Copy link
Copy Markdown
Collaborator

Fixes a possible deadlock in the OPTE port manager. When failing to add external IPs for a new port, we both the PortTicket and a lock guard around the mananger's mapping of all ports. Unforunately, we do that in the wrong order: PortTicket first, which attempts to take that same lock in its drop implementation. This drops the port lock earlier, to avoid a deadlock.

Fixes #10280

Fixes a possible deadlock in the OPTE port manager. When failing to add
external IPs for a new port, we both the `PortTicket` and a lock guard
around the mananger's mapping of all ports. Unforunately, we do that in
the wrong order: `PortTicket` first, which attempts to take that same
lock in its drop implementation. This drops the port lock earlier, to
avoid a deadlock.

Fixes #10280
Comment thread illumos-utils/src/opte/port_manager.rs Outdated
@bnaecker bnaecker requested a review from jgallagher April 16, 2026 20:39
Copy link
Copy Markdown
Contributor

@FelixMcFelix FelixMcFelix left a comment

Choose a reason for hiding this comment

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

Looks good; thanks for the quick turnaround!

@bnaecker bnaecker enabled auto-merge (squash) April 17, 2026 15:57
@bnaecker bnaecker merged commit a961f76 into main Apr 17, 2026
16 checks passed
@bnaecker bnaecker deleted the ben/drop-opte-lock-before-returning branch April 17, 2026 16:25
iliana pushed a commit that referenced this pull request Apr 21, 2026
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.

Failing to set external IPs can deadlock the OPTE port manager

3 participants