Open adamdebek opened 4 months ago
When directory stream is read the position in this stream with each entry read is incremented by 1. This posistion refers to next element in dirent linked list. But when garbage collector deletes entry which was already read, the linked list shifts but position stayes the same which cause entry which we would next read to fall behind our current postion and that entry will not be seen until next opendir()
or rewinddir()
.
I thought about blocking garbage collector on directory that is currently open, which would fix that, but it entails changing
struct jffs2_inode_info
by adding variable that would count opened streams on directory but it causes errors in other parts of jffs2. Maybe someone will come up with better solution.
Key functions to look at:
jffs2_readdir
(struct file file, struct dir_context ctx)jffs2_garbage_collect_deletion_dirent
(struct jffs2_sb_info c, struct jffs2_eraseblock jeb,
struct jffs2_inode_info f, struct jffs2_full_dirent fd)
During nightly on zynq7000-zedboard, project hash:
6f20df5
was encoutered an error: There is a check between output ofgnu ls
andbusybox ls
, which in our case it's just 2 invocation ofbusybox ls
(which should be fixed), but anyway 2 same execution ofls
gave diffrent outputs and it happened in 2 conesecutive testcases, which looks ilke there might be some bug in directory reading in kernel. The issue is hard to reproduce, but if I got some I will put it in the comments section.