-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Test: Readonly nix store mount still allows for reflinks #5513
Comments
Maybe that’s also possible with xattrs, but one very compelling argument for a read-only bind-mount is that thanks to mount namespaces we can remount the store rw inside the Nix process when needed, while keeping it read-only for the rest of the system. |
We used to set the immutable bit but we got rid of it because it caused problems (b9c2b4d). |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/use-of-shallow-copy-reflinks-on-btrfs-xfs-zfs/24430/15 |
At least for btrfs, this has been fixed in Linux. Modern kernels can now reflink across VFS boundaries as long as it's the same filesystem. |
@Atemu I am reopening this issue because even if no code changes are needed on Nix's side anymore, it would still be very nice to have a NixOS VM Integration test ensuring this works. |
In case anyone else is curious, the fix apparently landed in Linux 5.18 |
@Kha Thanks. Do you have a link to any sort of release notes? Or something else you read? |
Thanks @Atemu. So yeah, would I love to see is a basic NixOS test reproducing this, and linking the above mailing list message. |
N.B.from @Ericson2314: Author says bug is fixed elsewhere, but we should still have an integration test to ensure this doesn't regress.
Describe the bug
A clear and concise description of what the bug is.
If you have a problem with a specific package or NixOS,
you probably want to file an issue at https://github.com/NixOS/nixpkgs/issues.
Steps To Reproduce
$TMPDIR
in the same mount as /nix so that things can theoretically be reflinked (i.e.TMPDIR=/nix/var/nix/tmp/
where /nix is a sinlgle mount)cp --reflink=always
for efficiencyInvalid cross-device link
Expected behavior
A clear and concise description of what you expected to happen.
You should be able to reflink copy to the Nix store and back; its immutability should be achieved without a separate mount.
nix-env --version
outputAdditional context
Add any other context about the problem here.
Not being able to reflink across multiple mounts of the same FS is a kernel VFS limitation that is unlikely to be fixed any time soon.
The immutable xattr could be a good candidate. I kind of wonder why it wasn't chosen in the first place.
The text was updated successfully, but these errors were encountered: