Found+fixed a bug where arbitrary dir seeks can return unrelated entries
It turned out our dir-read-idempotent test never created non-dstart neighbors. This was a bit of a problem since we relied on dstart entries to know when our dir read terminates. If we seek to an invalid position (in theory undefined behavior, but easily possible with concurrent modifications to the directory), we can end up reading an unrealted, non-dstart entry, and incorrectly reporting that entry as in our current dir. This fix reintroduces the did into the lfsr_dir_t struct and uses the did to determine end-of-dir. This adds some RAM cost, but is more resilient to any seeks that overshoot the end of the directory. Using did is also a stronger guarantee we will never accidentally report unrelated entries as a part of the current directory.
This commit is contained in: