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

Inotify: Don't hold any locks when reading inode.parent. #9567

Closed
wants to merge 1 commit into from

Conversation

copybara-service[bot]
Copy link

Inotify: Don't hold any locks when reading inode.parent.

Now that inode.parent can be accessed atomically, we can read it without
holding any filesystem locks in InotifyWithParent(). This avoids a lot of lock
ordering violations.

Inotify is inherently a bit racy. Linux does not hold any locks after getting
the inode parent, so the parent is allowed to change between calling inotify on
the parent and child.

Now that inode.parent can be accessed atomically, we can read it without
holding any filesystem locks in InotifyWithParent(). This avoids a lot of lock
ordering violations.

Inotify is inherently a bit racy. Linux does not hold any locks after getting
the inode parent, so the parent is allowed to change between calling inotify on
the parent and child.

PiperOrigin-RevId: 575308256
@copybara-service copybara-service bot added the exported Issue was exported automatically label Oct 20, 2023
@copybara-service copybara-service bot closed this Oct 27, 2023
@copybara-service copybara-service bot deleted the test/cl575308256 branch October 27, 2023 19:08
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