Skip to content

fix(view): make removeMount locking cleanup exception-safe#62465

Draft
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-view-locking-removeMount
Draft

fix(view): make removeMount locking cleanup exception-safe#62465
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-view-locking-removeMount

Conversation

@joshtrichards

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Continuing my efforts to eliminate more "lock acquired, then an exception bypasses cleanup" pattern from another spot in the code base.

Make removeMount() release its lock on every exit.

This protects against exceptions from the umount hook, changeLock(), IMovableMount::removeMount(), or post_umount hook.

Also preserves non-cleanup exceptions and passes them on.

Why

removeMount() / movable-mount cleanup is not exception-safe:

  • removeMount() acquires a shared mount-point lock, emits an umount hook, promotes the lock to exclusive, calls removeMount(), downgrades, emits the post-hook, then unlocks.
  • If a hook, changeLock(), or the mount’s removeMount() implementation throws, neither the downgrade nor unlock is guaranteed. A try/finally should protect that sequence.

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
Assisted-by: Copilot:GPT-5.6

Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants