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

littlefs versioning #10

Closed
guillaumerems opened this issue Jan 19, 2018 · 6 comments
Closed

littlefs versioning #10

guillaumerems opened this issue Jan 19, 2018 · 6 comments

Comments

@guillaumerems
Copy link

Hi,

I propose to add a version number to the littlefs lib, for future improvements and new versions.

What about:

#define LFS_VERSION     20180119

int lfs_get_version(void){
    return LFS_VERSION;
}

It will be easier to follow features and issues

@geky
Copy link
Member

geky commented Jan 20, 2018

Hi @guillaumerems, I've been thinking of using GitHub's release tags to mark the current version.

What's the benefit of providing a runtime function to get the version number?

@guillaumerems
Copy link
Author

That's true that a runtime function is not so useful, but one benefit I see is that if there is an evolution of the storage scheme between 2 releases, then the library must know it to perform a migration or updates.
So the release could be stored in the superblock attribute

@geky
Copy link
Member

geky commented Jan 21, 2018

Ah, that's a good point. I haven't really thought about how to handle a breaking on-disk change. Although I'm not sure most devices are able to fit two versions of the filesystem in order to make the migration automatically.

The superblock does have a version field reserved, although this is currently just hardcoded to 1.1:
https://github.com/geky/littlefs/blob/1fb6a195206db4927e19fc27372553957da3d515/lfs.c#L2015

I'm thinking minor changes to the on-disk structures can be handled internally in the driver and won't need the user to get involved.

@geky
Copy link
Member

geky commented Jan 23, 2018

Another thought: We will probably need a separate LFS_VERSION and LFS_DISK_VERSION to version the software library and the on disk structures separately.

@guillaumerems
Copy link
Author

Agree ;)

@geky
Copy link
Member

geky commented Jan 26, 2018

I put up a proposal over here: #16

Let me know what you think.

I'm thinking I will hold off for now on a runtime function. If it's needed you can always provide it yourself in the same binary unit.

@geky geky closed this as completed Jan 29, 2018
geky added a commit that referenced this issue Aug 29, 2022
The main change here from the previous test framework design is:

1. Powerloss testing remains in-process, speeding up testing.

2. The state of a test, included all powerlosses, is encoded in the
   test id + leb16 encoded powerloss string. This means exhaustive
   testing can be run in CI, but then easily reproduced locally with
   full debugger support.

   For example:

   ./scripts/test.py test_dirs#reentrant_many_dir#10#1248g1g2 --gdb

   Will run the test test_dir, case reentrant_many_dir, permutation #10,
   with powerlosses at 1, 2, 4, 8, 16, and 32 cycles. Dropping into gdb
   if an assert fails.

The changes to the block-device are a work-in-progress for a
lazily-allocated/copy-on-write block device that I'm hoping will keep
exhaustive testing relatively low-cost.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants