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

nix/store on btrfs compression: add workaround #4057

Merged
merged 1 commit into from Sep 23, 2020

Conversation

martinetd
Copy link
Member

See #3550.

As suggested for now I've added a "preallocate-contents" option, and tested by restarting nix-daemon with /path/to/output/derivation/bin/nix-daemon --option preallocate-contents false

This works as a local fix but I definitely want to make this automatic for btrfs.

It's easy to call statfs(realStoreDir.c_str(), &statfsbuf) and check if statfsbuf.f_type == BTRFS_SUPER_MAGIC ; the question is how to make the setting "auto" ?

I'm thinking of:

  • changing from a Bool to a tristate true/false/auto enum; but would that work with the command-line --option switch? (I'm not too comfortable about introducing such a new setting type...)
  • if option is set to auto, check in localStore next to makeStoreWritable (e.g. some new checkFsQuirks method?), and if btrfs force the option somehow.. globalConfig.set? not really good with code compartimentization :/

Needless to say I don't like what I just suggested very much, so suggestions or comments welcome.
This is at least a starting point and folks who care can set the option in their nix.conf until then (depending on timing on the 3.0 release I'd be greedy and ask if it'd be possible to backport in 2.3 maintenance branch, but let's discuss that after we agree on the auto part I guess!)

Thanks!

Make archive preallocation (fallocate) optional because some filesystems
like btrfs do not behave as expected with fallocate.

See NixOS#3550.
@edolstra edolstra merged commit 8ee779d into NixOS:master Sep 23, 2020
@edolstra
Copy link
Member

Thanks, I've merged it. We could add auto-detect later if there is interest.

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

Successfully merging this pull request may close these issues.

None yet

2 participants