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

Grow block count to configured value when LFS_M_GROW mount flag is set #702

Closed

Conversation

kaetemi
Copy link
Contributor

@kaetemi kaetemi commented Jun 13, 2022

See #279

@kaetemi
Copy link
Contributor Author

kaetemi commented Jun 13, 2022

Test

    err = lfs_mount(&lfs, &cfg);
    lfs_unmount(&lfs);

    // fail without flag
    cfg.block_count += 1;
    err = lfs_mount(&lfs, &cfg);
    assert(err);

    // success with flag
    cfg.flags |= LFS_M_GROW;
    err = lfs_mount(&lfs, &cfg);
    assert(err == LFS_ERR_OK);
    lfs_unmount(&lfs);

    // cannot shrink
    cfg.flags = 0;
    cfg.block_count -= 1;
    err = lfs_mount(&lfs, &cfg);
    assert(err);

    // cannot shrink with flag either
    cfg.flags |= LFS_M_GROW;
    err = lfs_mount(&lfs, &cfg);
    assert(err);

@geky geky added enhancement needs minor version new functionality only allowed in minor versions labels Sep 8, 2022
@geky
Copy link
Member

geky commented Nov 9, 2022

Hi @kaetemi, thanks for the PR. This is a great implementation, but unfortunately I'm against the resizing behavior being implicit. I've added a comment with more info to the related issue #279.

I can modify this to be in a separate lfs_fs_grow function if you don't beat me to it.

I'm also hoping to address #349 in the next minor release, which means lfs_mount will probably have quite a few changes.

@geky
Copy link
Member

geky commented Dec 5, 2022

I've gone ahead and added lfs_fs_grow to #753, thanks for the original PR. I believe #753 replaces this now, but let me know if I'm missing anything.

@geky
Copy link
Member

geky commented Sep 21, 2023

Closing as this has been merged into #872 and should be mainlined shortly as a part of #877.

Feel free to reopen if you think I missed anything and thanks again for the PR!

@geky geky closed this Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs minor version new functionality only allowed in minor versions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants