Skip to content

vfs: establish lock ordering for FilesystemImpl.PrependPath #11173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Nov 13, 2024

vfs: establish lock ordering for FilesystemImpl.PrependPath

  • Add type parameter Filesystem to vfs/genericfstree, which is required to
    provide ancestryMu sync.RWMutex, and add such a RWMutex to all FSImpls that
    use genericfstree.

  • Modify genericfstree.PrependPath() and genericfstree.IsDescendant() to use
    ancestryMu to ensure atomicity. For callers of genericfstree.PrependPath(),
    this means that (broader) FSImpl locks no longer need to be held during the
    call. For callers of genericfstree.IsDescendant(), this means that we can
    remove documentation warnings about its non-atomicity.

  • Minor cleanup: Remove useless variable start, which is always 0, from
    MM.ReadMaps/SmapsDataInto().

@copybara-service copybara-service bot added the exported Issue was exported automatically label Nov 13, 2024
@copybara-service copybara-service bot force-pushed the test/cl696273175 branch 5 times, most recently from 905c667 to 4df0744 Compare November 14, 2024 20:33
@copybara-service copybara-service bot changed the title Establish lock ordering for vfs.FilesystemImpl.PrependPath. vfs: establish lock ordering for FilesystemImpl.PrependPath Nov 14, 2024
- Add type parameter Filesystem to vfs/genericfstree, which is required to
  provide `ancestryMu sync.RWMutex`, and add such a RWMutex to all FSImpls that
  use genericfstree.

- Modify genericfstree.PrependPath() and genericfstree.IsDescendant() to use
  ancestryMu to ensure atomicity. For callers of genericfstree.PrependPath(),
  this means that (broader) FSImpl locks no longer need to be held during the
  call. For callers of genericfstree.IsDescendant(), this means that we can
  remove documentation warnings about its non-atomicity.

- Minor cleanup: Remove useless variable `start`, which is always 0, from
  MM.ReadMaps/SmapsDataInto().

PiperOrigin-RevId: 696713993
@copybara-service copybara-service bot merged commit 0659b60 into master Nov 15, 2024
0 of 2 checks passed
@copybara-service copybara-service bot deleted the test/cl696273175 branch November 15, 2024 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exported Issue was exported automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant