fix(FSCommon): add nRF52 LittleFS empty-name guard to getFiles() - #10757
Conversation
…eFS bug workaround
|
@copilot trunk fmt |
Done — ran clang-format on |
… getFiles (#10778) Forward-port of #10754 and #10757 from master (2.7) into develop, so the develop->master 2.8 promotion (#10777) doesn't drop them. #10754: PhoneAPI no longer walks the filesystem to build the file manifest on node-info-only config requests (SPECIAL_NONCE_ONLY_NODES), which never consume it. getFiles() is now bounded (default 64 entries, depth 3) via collectFiles(), takes an optional wasLimited out-param, and reserves capacity with a bad_alloc/ length_error fallback. The manifest vector is freed via swap (releaseFilesManifest). #10757: getFiles()/collectFiles() now guard against empty file names returned by the Adafruit LittleFS nRF52 glue (issue 4395). Ported by hand rather than cherry-picked: master had reflowed FSCommon.cpp to a different brace style (every line conflicted), #10754 already subsumes #10757, and develop carries a MESHTASTIC_EXCLUDE_FILES_MANIFEST path (nRF54L15) that master lacks. The exclude path is preserved and now also short-circuits + frees the manifest. Verified: native Docker suite 448/448, clang-format clean.
… getFiles (meshtastic#10778) Forward-port of meshtastic#10754 and meshtastic#10757 from master (2.7) into develop, so the develop->master 2.8 promotion (meshtastic#10777) doesn't drop them. meshtastic#10754: PhoneAPI no longer walks the filesystem to build the file manifest on node-info-only config requests (SPECIAL_NONCE_ONLY_NODES), which never consume it. getFiles() is now bounded (default 64 entries, depth 3) via collectFiles(), takes an optional wasLimited out-param, and reserves capacity with a bad_alloc/ length_error fallback. The manifest vector is freed via swap (releaseFilesManifest). meshtastic#10757: getFiles()/collectFiles() now guard against empty file names returned by the Adafruit LittleFS nRF52 glue (issue 4395). Ported by hand rather than cherry-picked: master had reflowed FSCommon.cpp to a different brace style (every line conflicted), meshtastic#10754 already subsumes meshtastic#10757, and develop carries a MESHTASTIC_EXCLUDE_FILES_MANIFEST path (nRF54L15) that master lacks. The exclude path is preserved and now also short-circuits + frees the manifest. Verified: native Docker suite 448/448, clang-format clean.
|
Hi all, I know I repeat myself, but yet: again a big thank you to you all for your dedication in getting bugs resolved, nodes running more stable, and so on. I had a few mountain nrf52 Seeed Solar P1 nodes running in firmware 2.7.11, curiosity ... in any case, they stopped forwarding messages after about 5 months. It wasn't a node failure itself, it was a filesystem error most likely. After I updated to firmware 2.7.26, AND deleted the nodeDB, they started working again. Might sometimes also be a good idea if all fails to apply nrf_erase2.uf2 before firmware update, following the erase-guide on flasher.meshtastic.org (recycle bin symbol) to get a clean filesystem if all else fails. The only thing that puzzled me: when updating via nrfConnect App Android -ota.zip, something that always works with DFU / number of packets 5 and RAK4631 devices: the Seeed Solar P1 did not reboot after a complete and successful OTA upload of firmware. Manual power down and power up was required. Might this be a general problem with Seeed / Xiao-type boatloaders? I mean, once I force-started via power down / up, the node Seeed Solar with the new firmware 2.7.26 was available right away. Not good when a node is up high on a mast :-) |
getFiles()iterated withwhile (file)without thefile.name()[0]guard thatlistDir()already uses to work around the Adafruit LittleFS nRF52 glue bug (issue 4395), whereopenNextFile()can return aFilewith an empty name. This could cause empty-name entries to be pushed into results and the loop to spin untilmaxCountwas exhausted.Changes
src/FSCommon.cpp— updated the loop condition ingetFiles()to matchlistDir():🤝 Attestations