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

Add lfs_fs_grow to enable limited resizing of the filesystem #872

Merged
merged 17 commits into from
Sep 21, 2023
Merged

Commits on Aug 17, 2023

  1. Configuration menu
    Copy the full SHA
    7328527 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6dae703 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    be68122 View commit details
    Browse the repository at this point in the history
  4. Add a unit test; currently hanging on final permutation.

    Some block-device bound-checks are disabled during superblock search.
    BrianPugh committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    df238eb View commit details
    Browse the repository at this point in the history
  5. fix corruption check

    BrianPugh committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    6de3fc6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3d0bcf4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2ebfec7 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2023

  1. Configuration menu
    Copy the full SHA
    7521e0a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5caa83f View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2023

  1. linting

    BrianPugh committed Aug 20, 2023
    Configuration menu
    Copy the full SHA
    d6c0c6a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d6098bd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    23089d5 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2023

  1. Revert of refactor lfs_scan_* out of lfs_format

    This would result in two passes through the superblock chain during
    mount, when we can access everything we need to in one.
    geky committed Sep 3, 2023
    Configuration menu
    Copy the full SHA
    9c23329 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2023

  1. Adopted erase_size/erase_count config in test block-devices/runners

    In separating the configuration of littlefs from the physical geometry
    of the underlying device, we can no longer rely solely on lfs_config to
    contain all of the information necessary for the simulated block devices
    we use for testing.
    
    This adds a new lfs_*bd_config struct for each of the block devices, and
    new erase_size/erase_count fields. The erase_* name was chosen since
    these reflect the (simulated) physical erase size and count of
    erase-sized blocks, unlike the block_* variants which represent logical
    block sizes used for littlefs's bookkeeping.
    
    It may be worth adopting erase_size/erase_count in littlefs's config at
    some point in the future, but at the moment doesn't seem necessary.
    
    Changing the lfs_bd_config structs to be required is probably a good
    idea anyways, as it moves us more towards separating the bds from
    littlefs. Though we can't quite get rid of the lfs_config parameter
    because of the block-device API in lfs_config. Eventually it would be
    nice to get rid of it, but that would require API breakage.
    geky committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    027331b View commit details
    Browse the repository at this point in the history
  2. Added a couple mixed/unknown block_count tests

    These were cherry-picked from some previous work on a related feature.
    geky committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    127d84b View commit details
    Browse the repository at this point in the history
  3. Tweaked lfs_fsinfo block_size/block_count fields

    Mainly to match superblock ordering and emphasize these are logical
    blocks.
    geky committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    2c222af View commit details
    Browse the repository at this point in the history
  4. Added lfs_fs_grow for growing the filesystem to a different block_count

    The initial implementation for this was provided by kaetemi, originally
    as a mount flag. However, it has been modified here to be self-contained
    in an explicit runtime function that can be called after mount.
    
    The reasons for an explicit function:
    
    1. lfs_mount stays a strictly readonly operation, and avoids pulling in
       all of the write machinery.
    
    2. filesystem-wide operations such as lfs_fs_grow can be a bit risky,
       and irreversable. The action of growing the filesystem should be very
       intentional.
    
    ---
    
    One concern with this change is that this will be the first function
    that changes metadata in the superblock. This might break tools that
    expect the first valid superblock entry to contain the most recent
    metadata, since only the last superblock in the superblock chain will
    contain the updated metadata.
    geky committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    23505fa View commit details
    Browse the repository at this point in the history