-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: support truncate and close calls #13869
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
Area: File System
File System issues
Size: S
The size of the change in this PR is small
labels
Oct 7, 2024
[Experimental Bot, please feedback here] The PR does a good job of summarizing the changes and their impact. However, it's missing some key information required by the NuttX PR guidelines. Here's a breakdown of what's missing and how to improve the PR: Summary:
Impact:
Testing:
To improve the PR:
|
michallenc
force-pushed
the
notify_close
branch
from
October 7, 2024 09:38
7f2858a
to
074da6d
Compare
github-actions
bot
added
the
Area: Documentation
Improvements or additions to documentation
label
Oct 7, 2024
xiaoxiang781216
approved these changes
Oct 7, 2024
IN_MODIFY event should occur on file modification, which includes truncate. This is consistent with the inotify usage on Linux. Signed-off-by: Michal Lenc <[email protected]>
Close operation on file should lead to IN_CLOSE_WRITE or IN_CLOSE_NOWRITE notifications. This commits adds the notification support. Notifying on close is a little bit trickier as a lower layer may not have the full file path after successful close and inode release. Calling notification before close is not a solution since close might not end successfully. The solution is to obtain and buffer the path before calling close and then pass the buffered path to the notify_close. This required the change in notify_close function arguments: filep is no longer required, path and oflags are passed instead. Signed-off-by: Michal Lenc <[email protected]>
IN_CLOSE_WRITE and IN_CLOSE_NOWRITE are now supported and IN_MODIFY can be used for truncate as well. Signed-off-by: Michal Lenc <[email protected]>
michallenc
force-pushed
the
notify_close
branch
from
October 7, 2024 12:35
074da6d
to
8ba363c
Compare
xiaoxiang781216
approved these changes
Oct 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: Documentation
Improvements or additions to documentation
Area: File System
File System issues
Size: S
The size of the change in this PR is small
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
a1b14df
IN_MODIFY
event should occur on file modification, which includes truncate. This is consistent with the inotify usage on Linux.7f2858a
Close operation on file should lead to
IN_CLOSE_WRITE
orIN_CLOSE_NOWRITE
notifications. This commits adds the notification support. Notifying on close is a little bit trickier as a lower layer may not have the full file path after successful close and inode release. Calling notification before close is not a solution since close mightnot end successfully.
The solution is to obtain and buffer the path before calling close and then pass the buffered path to the notify_close. This required the change in
notify_close
function arguments:filep
is no longer required, path andoflags
are passed instead.Impact
Inotify now reports notification on close and truncate operations.
Testing
Tested on SAMv7 custom board.