Failed to remove empty directory #42
-
Unable to remove some empty directories. No entries found using code: And using: When How to fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @l1ndb3ck, can you share which version of Reliance Edge you are using? The faulty behavior you are describing sounds very similar to a bug which was fixed in Reliance Edge v2.6. That bug was fixed in commit 75b1efb on the
This problem is also mentioned in the release notes for v2.6:
If you are using a version of Reliance Edge which antedates that bug fix, I would recommend upgrading (or backporting the referenced commit) to prevent directories from getting into this broken state in the future. If you are using a version of Reliance Edge which includes that bug fix, then something else is going on. In that case, please attach your redconf.h and redconf.c, and share whatever you can about how your application is modifying directories. |
Beta Was this translation helpful? Give feedback.
-
Hi @danielrlewis |
Beta Was this translation helpful? Give feedback.
-
Hi @danielrlewis |
Beta Was this translation helpful? Give feedback.
-
Upgrading to Reliance Edge v2.6 will only prevent the directory size bug from occurring in the future. It will not retroactively fix broken directory sizes which already exist on the volume, which is the situation you are describing. If the volume is reformatted with v2.6, so that all the directories are recreated, then the problem won't recur. This is the only solution which is available using the code we have formally tested and released. If reformatting your volume(s) isn't possible, it would be possible to repair the broken directory sizes, either by scanning the volume for broken directories and repairing them all at once, or by fixing them as they are encountered during normal operations. The latter approach might look something like this patch: i.e., immediately prior to a directory deletion attempt, check if the directory size is broken, and (if it is) repair it. I will caution that the linked patch was hastily created, barely tested, and hasn't been reviewed by the broader team. If you would prefer a solution which has been through quality assurance, please contact sales@tuxera.com. |
Beta Was this translation helpful? Give feedback.
@l1ndb3ck:
Upgrading to Reliance Edge v2.6 will only prevent the directory size bug from occurring in the future. It will not retroactively fix broken directory sizes which already exist on the volume, which is the situation you are describing.
ino.pInodeBuf->ullSize
should be zero, but it's not because the v2.2 version ofRedDirEntryDelete()
did not update the size correctly. The v2.6 version ofRedDirEntryDelete()
has been fixed so that it won't introduce any further instances of this problem, but that doesn't repair any existing directories whose sizes were already broken by the old version of the function.If the volume is reformatted with v2.6, so that all the directories are recreat…