-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fs_dup2 bug fix, memleak #13458
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
fs_dup2 bug fix, memleak #13458
Conversation
file_ioctl failed, but close success, inode need release Signed-off-by: anjiahao <anjiahao@xiaomi.com>
|
[Experimental Bot, please feedback here] This pull request needs significant improvements to meet the NuttX requirements. Here's a breakdown of what's missing and how to improve it: Summary:
Impact:
Testing:
Example of an Improved Summary: ## Summary
This PR addresses an issue where a failed `file_ioctl` operation could lead to an inode leak. Currently, if `file_ioctl` fails under specific conditions, the file close operation succeeds but the inode is not released properly. This can exhaust system resources over time.
The change modifies the `fs/ioctl.c` file to ensure that the inode is released consistently, even if `file_ioctl` encounters an error. Specifically, the logic in the `ioctl` function is updated to release the inode before returning an error code in cases where it was previously being missed.
This PR fixes [link to NuttX issue if applicable].
## Impact
* **Is new feature added? Is existing feature changed?** NO (This is a bug fix)
* **Impact on user (will user need to adapt to change)?** NO
* **Impact on build (will build process change)?** NO
* **Impact on hardware (will arch(s) / board(s) / driver(s) change)?** NO
* **Impact on documentation (is update required / provided)?** NO
* **Impact on security (any sort of implications)?** NO (This fix improves resource management but does not introduce new security vulnerabilities)
* **Impact on compatibility (backward/forward/interoperability)?** NO
* **Anything else to consider?** N/A
## Testing
**Build Host:**
* OS: Ubuntu 20.04
* CPU: x86_64
* Compiler: GCC 9.4.0
**Target:**
* qemu-arm:sim:nsh
**Testing logs before change:**[output demonstrating the inode leak issue] [output showing the inode is now released correctly] By providing more detail and following the NuttX requirements, you'll make it much easier for reviewers to understand and approve your pull request. |
|
do we need so heavy process to handle a minor change? |
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :-)
Not really in this case, we are just testing review process improvements, @lupyuen created AI bot that will provide automated review with hints, this may help both reporters and reviewers, I think this is really great idea, especially in case of more complex PRs.. to be honest I am surprised to see this already working pretty well :-) |
Summary
file_ioctl failed, but close success, inode need release
Impact
NULL
Testing
qemu