Comments (3)
Hi @geky and thank you for your quick reply.
I confirm we are using 2.9.
I'm trying to reproduce the problem with a specific test function (written in c) in attach.
With this function, the problem does no appear and we reach 725000 iterations without any reset, 1 day running.
Our real process involve attributes, I don't know if it is correlated to... I don't think so.
I will try now to enrich the test function, including appending at the end of the process, instead of removing, in order to mimic the real scenario.
We also tried to replace (in the real environment) the lfs_rename function with a custom function that perform a file copy.
With this change, the problem does not occur.
I'll keep investigating and let you know...
from littlefs.
Hi @HariTheCoder341, thanks for creating an issue.
This is going to be difficult to debug. Is it possible to reduce this down into a locally-reproducible example? Preferably in a littlefs test case (example).
We also noticed that lfs_dir_relocatingcommit is called with pdir = NULL in three points, line 2433, 2494, 2545.
Are you sure you're using v2.9? I don't think these line numbers quite line up.
The pdir
argument here is actually a side-effect of lfs_dir_relocatingcommit
. It contains the previous mdir in the dir's linked-list if the mdir needs to be dropped (mdir.count=0
, LFS_OK_DROPPED). We need to find the pdir
in lfs_dir_relocatingcommit
to determine how to update the mlist, but we can't actually drop in lfs_dir_relocatingcommit
without recursion. A lot of the mess in these functions is tip-toeing around a flattened recursive algorithm.
But not every call to lfs_dir_relocatingcommit
can drop. This would not be solved by always providing pdir
, because the layer above would not be able to handle the resulting LFS_OK_DROPPED state correctly.
The Fixing move while relocating
message (here) is followed immediately by an lfs_dir_relocatingcommit
call with a delete tag, which is probably resulting a drop, which littlefs doesn't expect.
from littlefs.
Hi,
In the past few days I tried to write a test to reproduce the problem, without success.
The operations are the same as in the real application, but in a Linux environment they do not lead to the problem, which instead persists on STM32.
I attach the test code.
I confirm that by replacing the lfs_rename with a copy function, which replicates the purpose, we have no reset after extensive and continuous testing for 10 consecutive days.
I also generated a log file with LFS_YES_TRACE active, but it exceeds 1.5 GB, so I don't think it can be attached here or that it can be of any help, I'm only publishing the final part.
It takes a day and a half for the problem to occur... not knowing how to proceed, we will comment out the lfs_rename in favor of the copy for now.
from littlefs.
Related Issues (20)
- Mounting a loop device from c. HOT 1
- LittleFS not truncating previous file content when overwriting a file HOT 1
- lfs_filebd.c seems to assume errno values HOT 2
- Provide a function for probing for LFS HOT 12
- renaming symbols HOT 5
- pread/pwrite HOT 6
- When are file attributes deleted or not deleted? HOT 3
- Superblock corruption HOT 28
- is it safe to open a file multiple times? HOT 4
- lfs_remove doesn't have unlink/rmdir distinction HOT 4
- When are file attributes finally written to "disk"? HOT 2
- Block count defined twice HOT 1
- What is the "bd" folder? HOT 1
- why t1_buf is sample of t2_buf at sometime?
- Expanding superblock deletes File HOT 7
- '-fcallgraph-info=su' breaking builds on some platforms HOT 9
- All the data is lost after update from disk 2.0 to disk 2.1 HOT 3
- v2.7 : long delay in open/close for spi nor HOT 8
- Data Flash values after erase is "undefined" - Would LittleFS work? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from littlefs.