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? |
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