Summary:
In the x86 environment, memory does not necessarily start at 0, so when end is 0x0, start = end + 1, and then determine the contents of start, it will cause x86 to cause a crash when accessing an illegal address.
This problem does not occur in the arm environment because arm starts at 0x0, so the content of the 0x1 address is “\0”.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
1.The relpath information is stored in the fid structure
2.The relative path information is only saved in the client. When the server changes, the relpath saved in the fid will not change.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
When sending FIOC_XXXLK to hostfs, hostfs will return -1 by default. For ioctl statements, incompatible instructions should be processed as -ENOTTY by default
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
When handling errors through ioctl, the error returned by the server is always 0 on the client, because cookie.result is not assigned, the error returned should be in msg->result
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Refactoring path logic to prevent logic flaws, direntry size bug fix to allow proper direntry traversal, open free bug fix to prevent memory leak after close.
Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
This triggers `mm_free_delaylist()` before dumping status in PROTECTED
build, otherwise the `free` command still shows delaylist as `used`.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
According to the POSIX standard, `fstat` and `stat` should return 0
(`OK`) on success. This commit changed the underlying `spiffs`
implementation to follow the POSIX standard.
Unbinding `ff_currentcluster` and `f_pos`:
1. Added `ff_pos` in `struct fat_file_s`.
2. Added function `fat_zero_cluster` for doing zeroing for gap
between EOF and new position beyond EOF.
3. Added function `fat_get_sectors` for getting the sector where
`f_pos` is located, allocting new cluster when `f_pos` is beyond
EOF.
4. Modify function `fat_read`, and `fat_write` with above functions.
5. Remove redundant logics in `fat_seek` since now new cluster is
allocated when writing instead of seeking.
Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Add a common method to format backtrace to buffer, so it can be used by both mm, fs and other possoble modules.
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
sched implementation not depends on macro abstraction, so revert below commit:
This reverts commit 4e62d0005a
This reverts commit 0f0c370520
This reverts commit ad0efd04ee
Signed-off-by: chao an <anchao@lixiang.com>
pointer comparison is unsigned, when returning -errno will be converted
to a large positive number, can not enter the error handling branch,
therefore, the error code is returned directly and the sem is returned
through the parameters.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
if driver complete unlink ops, we need to call it to release some resource,
otherwise, it will only remove inode.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Change the type of task group member to single list chain to
avoid accessing the memory allocator to improve the performance
Signed-off-by: chao an <anchao@lixiang.com>
Pre-allocated files to avoid allocator access during thread creation
phase, For functional safety requirements, increase
CONFIG_NFILE_DESCRIPTORS_PER_BLOCK could also avoid allocator access
caused by the file descriptor exceeding the limit.
For Task Termination, the time consumption will be reduced ~3us (Tricore TC397 300MHZ):
10.65(us) -> 7.35(us)
NOTE:
This commit will not waste of extra heap, just pre-allocates the list of files for task_group.
Signed-off-by: chao an <anchao@lixiang.com>