Skip to content
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

Establish lock ordering for vfs.FilesystemImpl.PrependPath. #11173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

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

Establish lock ordering for vfs.FilesystemImpl.PrependPath.

  • Add type parameter Filesystem to vfs/genericfstree, which is required to
    provide ancestryMu sync.RWMutex.

  • 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
    IsDescendant() now has the same atomicity as Linux's fs/dcache.c:is_subdir(),
    so remove documentation warnings about its non-atomicity.

@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 2 times, most recently from db54edd to 73db556 Compare November 14, 2024 00:50
- Add type parameter Filesystem to vfs/genericfstree, which is required to
  provide `ancestryMu sync.RWMutex`.

- 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
  IsDescendant() now has the same atomicity as Linux's fs/dcache.c:is_subdir(),
  so remove documentation warnings about its non-atomicity.

PiperOrigin-RevId: 696273175
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