Skip to content
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

jffs2 readdir skipping entries #1117

Open
adamdebek opened this issue Jul 23, 2024 · 1 comment
Open

jffs2 readdir skipping entries #1117

adamdebek opened this issue Jul 23, 2024 · 1 comment
Labels
filesystems jffs2 jffs2 related issues

Comments

@adamdebek
Copy link
Contributor

adamdebek commented Jul 23, 2024

During nightly on zynq7000-zedboard, project hash: 6f20df5 was encoutered an error:
image
There is a check between output of gnu ls and busybox ls, which in our case it's just 2 invocation of busybox ls (which should be fixed), but anyway 2 same execution of ls 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.

@adamdebek adamdebek changed the title ls rare issue armv7a9-zynq7000-zedboard: busybox ls rare issue Jul 30, 2024
@adamdebek adamdebek changed the title armv7a9-zynq7000-zedboard: busybox ls rare issue jffs2 readdir skipping entries Aug 29, 2024
@adamdebek
Copy link
Contributor Author

adamdebek commented Aug 29, 2024

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:

  • static int jffs2_readdir(struct file *file, struct dir_context *ctx)
  • static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb,
    struct jffs2_inode_info *f, struct jffs2_full_dirent *fd)

@adamdebek adamdebek added the jffs2 jffs2 related issues label Aug 29, 2024
lukileczo added a commit that referenced this issue Sep 9, 2024
* libphoenix 49f0324...96c4c08 (4):
  > feat(signal): implement sigisemptyset and sigfillset
  > fix(signal): set errno on error
  > include: remove EALREADY, EINPROGRESS errnos
  > fix(exit): fflush after calling atexit handlers

* phoenix-rtos-build 9acad4d...97fb495 (1):
  > build.sh: add mkrofs to hostutils list

* phoenix-rtos-doc e7909f6...8c548c2 (2):
  > quickstart: add sparcv8leon3-gr716-mimas target
  > order images

* phoenix-rtos-filesystems ac000e1...63e36a5 (5):
  > rofs: fix review comments
  > rofs: fix TRACE format specifiers
  > rofs: fix dirfind return value
  > rofs: support native target endianness
  > rofs: introduce readonly file system

* phoenix-rtos-hostutils 8472cfa...03e833e (2):
  > mkrofs: allow creating BE & LE filesystems
  > mkrofs: introduce tool: make Read Only FS

* phoenix-rtos-kernel ca23837...b8de910 (2):
  > sparcv8leon3: allocate space for copied syspage
  > riscv64: allocate space for copied syspage

* phoenix-rtos-tests 21d61a7...3a22101 (1):
  > busybox: make ls test to run first due to #1117 issue
lukileczo added a commit that referenced this issue Sep 9, 2024
* libphoenix 49f0324...96c4c08 (4):
  > feat(signal): implement sigisemptyset and sigfillset
  > fix(signal): set errno on error
  > include: remove EALREADY, EINPROGRESS errnos
  > fix(exit): fflush after calling atexit handlers

* phoenix-rtos-build 9acad4d...97fb495 (1):
  > build.sh: add mkrofs to hostutils list

* phoenix-rtos-doc e7909f6...8c548c2 (2):
  > quickstart: add sparcv8leon3-gr716-mimas target
  > order images

* phoenix-rtos-filesystems ac000e1...63e36a5 (5):
  > rofs: fix review comments
  > rofs: fix TRACE format specifiers
  > rofs: fix dirfind return value
  > rofs: support native target endianness
  > rofs: introduce readonly file system

* phoenix-rtos-hostutils 8472cfa...03e833e (2):
  > mkrofs: allow creating BE & LE filesystems
  > mkrofs: introduce tool: make Read Only FS

* phoenix-rtos-kernel ca23837...b8de910 (2):
  > sparcv8leon3: allocate space for copied syspage
  > riscv64: allocate space for copied syspage

* phoenix-rtos-tests 21d61a7...3a22101 (1):
  > busybox: make ls test to run first due to #1117 issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filesystems jffs2 jffs2 related issues
Projects
None yet
Development

No branches or pull requests

1 participant